示例#1
0
 /**
  * Create a new mail list for the customer
  * 
  * The $data param must contain following indexed arrays:
  * -> customer
  * -> company
  * 
  * @param array $data
  * @return EmailOneApi_Http_Response
  */
 public function create(array $data)
 {
     if (isset($data['customer']['password'])) {
         $data['customer']['confirm_password'] = $data['customer']['password'];
     }
     if (isset($data['customer']['email'])) {
         $data['customer']['confirm_email'] = $data['customer']['email'];
     }
     if (empty($data['customer']['timezone'])) {
         $data['customer']['timezone'] = 'UTC';
     }
     $client = new EmailOneApi_Http_Client(array('method' => EmailOneApi_Http_Client::METHOD_POST, 'url' => $this->config->getApiUrl('customers'), 'paramsPost' => $data));
     return $response = $client->request();
 }
 /**
  * Delete existing transactional email
  * 
  * @param string $emailUid
  * @return EmailOneApi_Http_Response
  */
 public function delete($emailUid)
 {
     $client = new EmailOneApi_Http_Client(array('method' => EmailOneApi_Http_Client::METHOD_DELETE, 'url' => $this->config->getApiUrl(sprintf('transactional-emails/%s', $emailUid))));
     return $response = $client->request();
 }
示例#3
0
 /**
  * Get fields from a certain mail list
  * 
  * Note, the results returned by this endpoint can be cached.
  * 
  * @param string $listUid
  * @return EmailOneApi_Http_Response
  */
 public function getFields($listUid)
 {
     $client = new EmailOneApi_Http_Client(array('method' => EmailOneApi_Http_Client::METHOD_GET, 'url' => $this->config->getApiUrl(sprintf('lists/%s/fields', $listUid)), 'paramsGet' => array(), 'enableCache' => true));
     return $response = $client->request();
 }
示例#4
0
 /**
  * Get all available country zones
  * 
  * Note, the results returned by this endpoint can be cached.
  * 
  * @param integer $countryId
  * @param integer $page
  * @param integer $perPage
  * @return EmailOneApi_Http_Response
  */
 public function getZones($countryId, $page = 1, $perPage = 10)
 {
     $client = new EmailOneApi_Http_Client(array('method' => EmailOneApi_Http_Client::METHOD_GET, 'url' => $this->config->getApiUrl(sprintf('countries/%d/zones', $countryId)), 'paramsGet' => array('page' => (int) $page, 'per_page' => (int) $perPage), 'enableCache' => true));
     return $response = $client->request();
 }
示例#5
0
 /**
  * Get segments from a certain mail list
  * 
  * Note, the results returned by this endpoint can be cached.
  * 
  * @param string $listUid
  * @param integer $page
  * @param integer $perPage
  * @return EmailOneApi_Http_Response
  */
 public function getSegments($listUid, $page = 1, $perPage = 10)
 {
     $client = new EmailOneApi_Http_Client(array('method' => EmailOneApi_Http_Client::METHOD_GET, 'url' => $this->config->getApiUrl(sprintf('lists/%s/segments', $listUid)), 'paramsGet' => array('page' => (int) $page, 'per_page' => (int) $perPage), 'enableCache' => true));
     return $response = $client->request();
 }
示例#6
0
 /**
  * Search in a list gor given subscriber by email address
  * 
  * @param string $listUid
  * @param string $emailAddress
  * @return EmailOneApi_Http_Response
  */
 public function emailSearch($listUid, $emailAddress)
 {
     $client = new EmailOneApi_Http_Client(array('method' => EmailOneApi_Http_Client::METHOD_GET, 'url' => $this->config->getApiUrl(sprintf('lists/%s/subscribers/search-by-email', (string) $listUid)), 'paramsGet' => array('EMAIL' => (string) $emailAddress)));
     return $response = $client->request();
 }