Ejemplo n.º 1
0
 /**
  * @param \DotBlue\Mandrill\Message $message
  * @param \Nette\Mail\Message $originalMessage
  */
 private function setRecipients(\DotBlue\Mandrill\Message $message, \Nette\Mail\Message $originalMessage)
 {
     $to = $originalMessage->getHeader('To') ?: [];
     foreach ($to as $email => $name) {
         $message->addTo($email, $name);
     }
     $cc = $originalMessage->getHeader('Cc') ?: [];
     foreach ($cc as $email => $name) {
         $message->addCc($email, $name);
     }
     $bcc = $originalMessage->getHeader('Bcc') ?: [];
     foreach ($bcc as $email => $name) {
         $message->addBcc($email, $name);
     }
     $originalMessage->clearHeader('To');
     $originalMessage->clearHeader('Cc');
     $originalMessage->clearHeader('Bcc');
 }