Ejemplo n.º 1
0
 /**
  * @param \Generated\Shared\Transfer\MailTransfer $mailTransfer
  *
  * @return \Generated\Shared\Transfer\SendMailResponsesTransfer
  */
 public function sendMail(MailTransfer $mailTransfer)
 {
     $templateName = $mailTransfer->getTemplateName();
     $templateContent = $this->convertToJsonStyle($mailTransfer->getTemplateContent());
     $message = $this->extractMessage($mailTransfer);
     $async = $mailTransfer->getAsync();
     $ipPool = $mailTransfer->getIpPool();
     $sendAt = $mailTransfer->getSendAt();
     if ($sendAt !== null) {
         $sendAt = (new \DateTime($sendAt))->format('Y-m-d H:i:s');
     }
     $responses = (array) $this->mandrill->messages->sendTemplate($templateName, $templateContent, $message, $async, $ipPool, $sendAt);
     return $this->convertResponsesToTransfer($responses);
 }