'Verification Code', ]; } /** * Sends an email to the specified email address using the information collected by this model. * * @param MailerInterface $mailer the mailer component. * @param string $email the target email address. * @param string $senderEmail the sender email address. * @param string $senderName the sender name. * * @return bool whether the model passes validation. */ public function contact(MailerInterface $mailer, string $email, string $senderEmail, string $senderName): bool { if ($this->validate()) { $mailer->compose() ->setTo($email) ->setFrom([$senderEmail => $senderName]) ->setReplyTo([$this->email => $this->name]) ->setSubject($this->subject) ->setTextBody($this->body) ->send(); return true; } return false; } }