public function generateEmailForgotPassword() { if (!empty($emailTo = $this->email)) { $mail = new Mail(); $mail->to = $emailTo; $mail->subject = Yii::t('app', 'Information from {store_name}', ['store_name' => Property::getPropertyValue('store_name', '')]); $mail->body = StoreUtils::renderView('//mail/_destination_forgot_password', ['model' => $this]); $mail->save(); } }
/** * Sends an email to the specified email address using the information collected by this model. * @param string $email the target email address * @return boolean whether the model passes validation */ public function contact($email) { if ($this->validate()) { $mail = new Mail(); $mail->subject = $this->subject; $mail->body = StoreUtils::renderView('//mail/_contact', ['model' => $this]); $mail->to = $email; $mail->save(); return true; } return false; }
/** * Sends an email to the specified email address using the information collected by this model. * @param string $email the target email address * @return boolean whether the model passes validation */ public function contact($email) { if ($this->validate()) { $mail = new Mail(); $mail->subject = Yii::t('app', 'Comment received on {store}', ['store' => Property::getPropertyValue('store_name', '')]); $mail->body = StoreUtils::renderView('//mail/_comment', ['model' => $this]); $mail->to = $email; $mail->save(); return true; } return false; }