public function sendForgotEmailMessage($to, $model) { $mailService = $this->getServiceManager()->get('goaliomailservice_message'); $from = $this->options->getEmailFromAddress(); $subject = $this->options->getResetEmailSubjectLine(); $template = $this->options->getResetEmailTemplate(); $message = $mailService->createTextMessage($from, $to, $subject, $template, array('record' => $model)); $mailService->send($message); }
public function __construct($emailValidator, ForgotOptionsInterface $options) { $this->setOptions($options); $this->emailValidator = $emailValidator; $this->add(array('name' => 'email', 'required' => true, 'validators' => array(array('name' => 'EmailAddress')))); if ($this->options->getValidateExistingRecord()) { $this->add(array('name' => 'email', 'validators' => array($this->emailValidator))); } }