コード例 #1
0
 protected function getCampaignOptions(DeliveranceMailChimpCampaign $campaign)
 {
     $title = $campaign->getTitle();
     if ($title == null) {
         throw new DeliveranceCampaignException('Campaign “Title” is null');
     }
     $subject = $campaign->getSubject();
     if ($subject == null) {
         throw new DeliveranceCampaignException('Campaign “Subject” is null');
     }
     $from_address = $campaign->getFromAddress();
     if ($from_address == null) {
         throw new DeliveranceCampaignException('Campaign “From Address” is null');
     }
     $from_name = $campaign->getFromName();
     if ($from_name == null) {
         throw new DeliveranceCampaignException('Campaign “From Name” is null');
     }
     $to_name = $campaign->getToName();
     $options = array('list_id' => $this->shortname, 'title' => $title, 'subject' => $subject, 'from_email' => $from_address, 'from_name' => $from_name, 'to_name' => $to_name, 'authenticate' => 'true', 'inline_css' => true, 'timewarp' => $campaign->timewarp, 'ecomm360' => $campaign->track_orders);
     if ($this->app->config->deliverance->automatic_analytics_tagging) {
         $key = $campaign->getAnalyticsKey();
         if ($key != '') {
             $options['analytics'] = array('google' => $key);
         }
     }
     if ($this->app->config->mail_chimp->default_folder != null) {
         $options['folder_id'] = $this->app->config->mail_chimp->default_folder;
     }
     return $options;
 }