|
- <?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@opendistrib.net' => 'distrib'])
- ->setSubject('[distrib] '.$subject)
- ->send();
- }
- }
|