currentURL; } /** * @inheritdoc */ public function attributeLabels() { return [ 'verifyCode' => 'Verification Code' ]; } /** * 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 email was sent */ public function sendEmail() { $bodytxt=$this->body; $subjecttxt='Feedback from GGBN'; if(!empty($this->subject)) $subjecttxt.=": ".$this->subject; if(!empty($this->email)) $bodytxt.="\n Sent from (email): ".$this->email; if(!empty($this->name)) $bodytxt.="\n Sent from (name): ".$this->name; $bodytxt.="\n IP USED: ".Yii::$app->request->userIP; return Yii::$app->mailer->compose() ->setFrom(Yii::$app->params ['noreplyMail']) ->setTo(Yii::$app->params['feedbackMail']) ->setSubject($subjecttxt) ->setTextBody($bodytxt) ->send(); } }