/**
  * @param string $email
  * @param string $token
  *
  * @return \Generated\Shared\Transfer\SendMailResponsesTransfer
  */
 public function send($email, $token)
 {
     $mailTransfer = new MailTransfer();
     $mailRecipientTransfer = new MailRecipientTransfer();
     $mailRecipientTransfer->setEmail($email);
     $mailTransfer->addRecipient($mailRecipientTransfer);
     $mailTransfer->setSubject(static::SUBJECT);
     $mailTransfer->setTemplateName(static::TEMPLATE);
     $mailTransfer->setMerge(true);
     $mailTransfer->setMergeLanguage('handlebars');
     $mailTransfer->setGlobalMergeVars(['reset_password_token' => $token]);
     $this->getFactory()->getMailFacade()->sendMail($mailTransfer);
 }
Example #2
0
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  * @param string $email
  *
  * @return void
  */
 protected function addMailRecipient(MailTransfer $mailTransfer, $email)
 {
     $mailRecipientTransfer = new MailRecipientTransfer();
     $mailRecipientTransfer->setEmail($email);
     $mailTransfer->addRecipient($mailRecipientTransfer);
 }