public function run()
 {
     // Initialize the library
     $silverpop = new EngagePod(array('username' => $this->config['username'], 'password' => $this->config['#password'], 'engage_server' => $this->config['engage_server']));
     if (!empty($this->config['debug']) && $this->config['debug'] === true) {
         $silverpop->setDebug(true);
     }
     // export aggregated metrics
     if ($this->config['export_aggregated_reports'] === 1) {
         $this->exportAggregatedMetrics($silverpop);
     }
     // export events
     if ($this->config['export_events'] === 1) {
         $this->exportEvents($silverpop);
     }
     // export contact list
     if ($this->config['export_contact_lists'] === 1) {
         $this->exportContactLists($silverpop);
     }
 }
Example #2
0
 public function addSilverpopOrderData()
 {
     $silverpop = new EngagePod();
     $orderProducts = $this->getOrderProducts();
     // build data columns
     $columns = array('Email2' => $this->customer->email, 'Address' => $this->address->address1, 'City' => $this->address->city, 'Country' => $this->address->country->country_name, 'First Name' => $this->customer->fname, 'Last Name' => $this->customer->lname, 'Campaign ID' => $this->campaign_id, 'Campaign Name' => $this->campaign->campaign_name, 'Phone' => $this->address->phone, 'Order ID' => $this->order_id, 'State' => $this->address->getStateName(), 'Zip' => $this->address->zip, 'AFID' => isset($this->affiliate->aff_ref) ? $this->affiliate->aff_ref : '', 'Order Created' => $this->created, 'Product Name' => $orderProducts[0]['product_name'], 'Customer ID' => $this->customer_id);
     $result = $silverpop->insertRelationalData(0, $columns);
 }
Example #3
0
 public function updateSilverpopCustomer()
 {
     $silverpop = new EngagePod();
     // grab recipient id
     $result = $silverpop->getProspect(0, $this->prospect_id);
     // update the field is_customer
     $result = $silverpop->updateContactToCustomer(0, $result['RecipientId']);
 }