/**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  *
  * @return void
  */
 protected function setMailTransferSubject(MailTransfer $mailTransfer)
 {
     $subject = $this->config->getRegistrationSubject();
     if ($subject !== null) {
         $mailTransfer->setSubject($this->translate($subject));
     }
 }
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  *
  * @return void
  */
 protected function setMailTransferSubject(MailTransfer $mailTransfer)
 {
     $subject = $this->config->getPasswordRestoreSubject();
     if ($subject !== null) {
         $mailTransfer->setSubject($this->translate($subject));
     }
 }
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  *
  * @return void
  */
 protected function setMailTransferFrom(MailTransfer $mailTransfer)
 {
     $fromName = $this->config->getFromEmailName();
     if ($fromName !== null) {
         $mailTransfer->setFromName($fromName);
     }
     $fromEmail = $this->config->getFromEmailAddress();
     if ($fromEmail !== null) {
         $mailTransfer->setFromEmail($fromEmail);
     }
 }
Example #4
0
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  * @param \Spryker\Zed\Payolution\PayolutionConfig $config
  *
  * @return void
  */
 protected function setMailTransferSubject(MailTransfer $mailTransfer, PayolutionConfig $config)
 {
     $subject = $config->getEmailSubject();
     if ($subject !== null) {
         $mailTransfer->setSubject($this->translate($subject));
     }
 }
 /**
  * @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 #6
0
 /**
  * @return void
  */
 public function testSendMailIsCalledWithRightIpSendAt()
 {
     $mailTransfer = new MailTransfer();
     $mailTransfer->setSendAt('2014-10-11 10:00:00');
     $this->mandrillMock->messages->expects($this->once())->method('sendTemplate')->with($this->anything(), $this->anything(), $this->anything(), $this->anything(), $this->anything(), $this->equalTo('2014-10-11 10:00:00'));
     $this->mailSender->sendMail($mailTransfer);
 }
Example #7
0
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  *
  * @return array
  */
 protected function extractMessage(MailTransfer $mailTransfer)
 {
     return ['subject' => $mailTransfer->getSubject(), 'from_email' => $mailTransfer->getFromEmail(), 'from_name' => $mailTransfer->getFromName(), 'to' => $this->extractRecipients($mailTransfer->getRecipients()), 'headers' => $this->extractHeaders($mailTransfer->getHeaders()), 'important' => $mailTransfer->getImportant(), 'track_opens' => $mailTransfer->getTrackOpens(), 'track_clicks' => $mailTransfer->getTrackClicks(), 'auto_text' => $mailTransfer->getAutoText(), 'auto_html' => $mailTransfer->getAutoHtml(), 'inline_css' => $mailTransfer->getInlineCss(), 'url_strip_qs' => $mailTransfer->getUrlStripQueryString(), 'preserve_recipients' => $mailTransfer->getPreserveRecipients(), 'view_content_link' => $mailTransfer->getViewContentLink(), 'bcc_address' => $mailTransfer->getBccAddress(), 'tracking_domain' => $mailTransfer->getTrackingDomain(), 'signing_domain' => $mailTransfer->getSigningDomain(), 'return_path_domain' => $mailTransfer->getReturnPathDomain(), 'merge' => $mailTransfer->getMerge(), 'merge_language' => $mailTransfer->getMergeLanguage(), 'global_merge_vars' => $this->convertToJsonStyle($mailTransfer->getGlobalMergeVars()), 'merge_vars' => $this->extractMergeVars($mailTransfer->getRecipients()), 'tags' => $mailTransfer->getTags(), 'subaccount' => $mailTransfer->getSubAccount(), 'google_analytics_domains' => $mailTransfer->getGoogleAnalyticsDomains(), 'google_analytics_campaign' => $mailTransfer->getGoogleAnalyticsCampaign(), 'metadata' => $mailTransfer->getMetadata(), 'recipient_metadata' => $this->extractRecipientMetadata($mailTransfer->getRecipients()), 'attachments' => $this->extractFiles($mailTransfer->getAttachments()), 'images' => $this->extractFiles($mailTransfer->getImages())];
 }
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  * @param \Spryker\Zed\Newsletter\NewsletterConfig $config
  *
  * @return void
  */
 protected function setMailTransferFrom(MailTransfer $mailTransfer, NewsletterConfig $config)
 {
     $fromName = $config->getFromEmailName();
     if ($fromName !== null) {
         $mailTransfer->setFromName($fromName);
     }
     $fromEmail = $config->getFromEmailAddress();
     if ($fromEmail !== null) {
         $mailTransfer->setFromEmail($fromEmail);
     }
 }