diff --git a/common/components/Mailer.php b/common/components/Mailer.php index dd3ff5a..e63a8e2 100755 --- a/common/components/Mailer.php +++ b/common/components/Mailer.php @@ -9,6 +9,7 @@ class Mailer extends Widget{ public $email; public $text; public $subject; + public $type; public function init(){ @@ -27,7 +28,7 @@ class Mailer extends Widget{ $mail->Password = "k0l0b04eg"; $mail->SetFrom('dockdep@gmail.com'); $mail->Subject = $this->subject; - $mail->MsgHTML($this->text); + $mail->MsgHTML($this->render($this->type)); $address = "dockdep@gmail.com"; $mail->AddAddress($address); $mail->AddAddress($this->email); diff --git a/common/models/Customer.php b/common/models/Customer.php index 7208ab9..f4ae1f4 100755 --- a/common/models/Customer.php +++ b/common/models/Customer.php @@ -76,13 +76,8 @@ class Customer extends \yii\db\ActiveRecord implements \yii\web\IdentityInterfac } public function sendMsg(){ - $body = 'Вас приветствует сайт Rukzachok'; - $body .= "\n\r"; - $body .= 'Ваш логин: '.$this->username; - $body .= "\n\r"; - $body .= 'Ваш пароль: '.$this->password; - Mailer::widget(['text'=> $body, 'subject'=> 'Спасибо за регистрацию', 'email' => $this->username ]); + Mailer::widget(['type' => 'registration', 'subject'=> 'Спасибо за регистрацию', 'email' => $this->username ]); } diff --git a/common/widgets/views/registration.php b/common/widgets/views/registration.php new file mode 100644 index 0000000..66bf353 --- /dev/null +++ b/common/widgets/views/registration.php @@ -0,0 +1 @@ + \ No newline at end of file -- libgit2 0.21.4