|
12345678910111213141516171819 |
- <?php
-
- namespace common\helpers;
-
- use Yii;
-
- class Mail {
- public static function send($email, $subject, $view, $data) {
- $mail = Yii::$app->mailer->compose(
- [ 'html' => $view.'-html',
- 'text' => $view.'-text'
- ],
- $data)
- ->setTo($email)
- ->setFrom(['contact@laboiteapain.net' => 'La boîte à pain'])
- ->setSubject('[La boîte à pain] '.$subject)
- ->send();
- }
- }
|