/** * @param IFeedbackForm $form * @return bool */ public function send(IFeedbackForm $form) { $emailBody = Yii::app()->getController()->renderPartial('feedbackEmail', ['model' => $form], true); foreach (explode(',', $this->module->emails) as $email) { $this->mail->send($this->module->notifyEmailFrom, $email, $form->getTheme(), $emailBody, false, [$form->getEmail() => $form->getName()]); } if ($this->module->sendConfirmation) { $this->sendConfirmation($form); } return true; }
/** * @param IFeedbackForm $form * @return bool */ public function send(IFeedbackForm $form) { $feedback = new FeedBack(); $feedback->setAttributes(['name' => $form->getName(), 'email' => $form->getEmail(), 'theme' => $form->getTheme(), 'text' => $form->getText(), 'phone' => $form->getPhone(), 'type' => $form->getType()]); if ($feedback->save()) { if ($this->module->sendConfirmation) { return $this->sendConfirmation($form, $feedback); } return true; } return false; }