Commit dc7900a3c3fa5fb826ca779099a46d9eaa4759a6

Authored by Administrator
1 parent 8e4ec95c

01.06.16

common/widgets/Mailer.php
@@ -10,6 +10,8 @@ class Mailer extends Widget{ @@ -10,6 +10,8 @@ class Mailer extends Widget{
10 public $text; 10 public $text;
11 public $subject; 11 public $subject;
12 public $type; 12 public $type;
  13 + public $params;
  14 +
13 15
14 public function init(){ 16 public function init(){
15 17
@@ -24,11 +26,11 @@ class Mailer extends Widget{ @@ -24,11 +26,11 @@ class Mailer extends Widget{
24 $mail->IsSMTP(); 26 $mail->IsSMTP();
25 27
26 $mail->CharSet = 'UTF-8'; 28 $mail->CharSet = 'UTF-8';
27 - $mail->Username = "dockdep@gmail.com";  
28 - $mail->Password = "k0l0b04eg@"; 29 + $mail->Username = "adwords@artweb.ua";
  30 + $mail->Password = "eks,ybcm5hfp";
29 $mail->SetFrom('dockdep@gmail.com'); 31 $mail->SetFrom('dockdep@gmail.com');
30 $mail->Subject = $this->subject; 32 $mail->Subject = $this->subject;
31 - $mail->MsgHTML($this->render('test')); 33 + $mail->MsgHTML($this->render($this->type, ['params' => $this->params]));
32 $address = "dockdep@gmail.com"; 34 $address = "dockdep@gmail.com";
33 $mail->AddAddress($address); 35 $mail->AddAddress($address);
34 // $mail->AddAddress($this->email); 36 // $mail->AddAddress($this->email);
common/widgets/views/registration.php
1 -<?= 'Спасибо за регистрацию'?>  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +<?= 'Спасибо за регистрацию '. $params['name']?>
3 \ No newline at end of file 3 \ No newline at end of file
frontend/controllers/RegController.php
@@ -58,7 +58,15 @@ class RegController extends Controller @@ -58,7 +58,15 @@ class RegController extends Controller
58 $modelLogin->username = $model->username; 58 $modelLogin->username = $model->username;
59 $modelLogin->password = $model->password; 59 $modelLogin->password = $model->password;
60 $modelLogin->login(); 60 $modelLogin->login();
61 - //Mailer::widget(['type' => 'registration', 'subject'=> 'Спасибо за регистрацию', 'email' => $model->username ]); 61 + Mailer::widget(
  62 + ['type' => 'registration',
  63 + 'subject'=> 'Спасибо за регистрацию',
  64 + 'email' => $model->username,
  65 + 'params' => [
  66 + 'name' => $model->username,
  67 + 'pass' => $model->password,
  68 + ]
  69 + ]);
62 $this->redirect(['/iam']); 70 $this->redirect(['/iam']);
63 } 71 }
64 72
frontend/views/basket/success.php
@@ -26,7 +26,7 @@ if(isset($variants) &amp;&amp; isset($order)){ @@ -26,7 +26,7 @@ if(isset($variants) &amp;&amp; isset($order)){
26 });"; 26 });";
27 27
28 } 28 }
29 - $orderData = "ga('ecommerce:send');"; 29 + $orderData .= "ga('ecommerce:send');";
30 $this->registerJs ($orderData, View::POS_BEGIN); 30 $this->registerJs ($orderData, View::POS_BEGIN);
31 31
32 } 32 }