コード例 #1
1
 /**
  * Send a transactional email
  *
  * @param TransactionalEmail $tEmail
  */
 public function send(TransactionalEmail $tEmail)
 {
     $attributes = $this->handleAttributes($tEmail->getAttributes());
     $recipients = $this->handleRecipients($tEmail->getRecipients());
     $recipientsCc = $this->handleRecipients($tEmail->getCarbonCopies());
     $recipientsBcc = $this->handleRecipients($tEmail->getBlindCarbonCopies());
     $to = implode('|', $recipients);
     $cc = implode('|', $recipientsCc);
     $bcc = implode('|', $recipientsBcc);
     $attachmentUrl = '';
     $attachment = array();
     $this->service->send_transactional_template(array('id' => $tEmail->getTemplateId(), 'to' => $to, 'cc' => $cc, 'bcc' => $bcc, 'attr' => $attributes, 'attachment_url' => $attachmentUrl, 'attachment' => $attachment, 'headers' => array()));
 }
コード例 #2
0
 /**
  * Checking if we receive a not supported option
  * 
  * @param TransactionalEmail $tEmail
  *
  * @throws \Exception
  */
 private function sendCheckSupportedOptions(TransactionalEmail $tEmail)
 {
     $supportedValues = EnumTransactionalEmailOption::getSupportedValues();
     foreach ($tEmail->getOptions() as $option) {
         if (!in_array($option, $supportedValues)) {
             throw new \Exception('Transactional email : This option (' . $option . ') is not supported by CampaignCommander.');
         }
     }
 }