Beispiel #1
0
 public function sendAnswer()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['awarness']->settings;
     return Mail::send($this->email, $this->answer_subject, $settings['answerTemplate'], ['awarness' => $this], ['replyTo' => Setting::get('admin_email')]);
 }
Beispiel #2
0
 public function notifyUser()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['guestbook']->settings;
     return Mail::send($this->email, $settings['subjectNotifyUser'], $settings['templateNotifyUser'], ['post' => $this, 'link' => Url::to([$settings['frontendGuestbookRoute']], true)]);
 }
Beispiel #3
0
 public function mailUser()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings;
     if (!$settings['mailUserOnNewOrder']) {
         return false;
     }
     /*
     var_dump(Page::get('order-success-user-mail-template')->getParsedText([
     	'name' => $data['name'],
     	'phone' => $data['phone'],
     	'email' => $data['email'],
     	'order_sum' => $model->cost,
     	'order_list' => $mainBehavior->formatOrderList($this->order)
     ]));
     */
     try {
         return Mail::send($this->email, $settings['subjectNotifyUser'], $settings['templateUserOnNewOrder'], ArrayHelper::merge(Shopcart::obj()->getBehavior('main')->prepareOrderEmailParameters($this), ['order' => $this]));
     } catch (\Swift_SwiftException $ex) {
         Yii::error('Отправка письма не удалась: ' . $ex->getMessage());
         return true;
     }
 }
Beispiel #4
0
 public function notifyUser()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings;
     return Mail::send($this->email, $settings['subjectNotifyUser'], $settings['templateNotifyUser'], ['order' => $this, 'link' => Url::to([$settings['frontendShopcartRoute'], 'id' => $this->primaryKey, 'token' => $this->access_token], true)]);
 }
 public function sendAnswer()
 {
     $moduleName = FeedbackModule::getModuleName(FeedbackModule::className());
     $settings = Yii::$app->getModule('admin')->activeModules[$moduleName]->settings;
     return Mail::send($this->email, $this->answer_subject, $settings['answerTemplate'], ['feedback' => $this], ['replyTo' => Setting::get('admin_email')]);
 }
Beispiel #6
0
 public function mailUser()
 {
     $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings;
     if (!$settings['mailUserOnNewOrder']) {
         return false;
     }
     try {
         return Mail::send($this->model->email, $settings['subjectUserOnNewOrder'], $settings['templateUserOnNewOrder'], ArrayHelper::merge(Shopcart::obj()->getBehavior('main')->prepareOrderEmailParameters($this), ['order' => $this]));
     } catch (\Swift_SwiftException $ex) {
         Yii::error('Отправка письма не удалась: ' . $ex->getMessage());
         return true;
     }
 }