/** * Re-subscribes an unsibscribed member using his/her ID. * REMARK: The number of rejoins per day is limited to avoid massive rejoins and illegal usage of this method. * * @param string $id The ID of the member. * * @return string The job ID of the unjoin, see getJobStatus(). * * @throws \Exception */ public function rejoinMemberById($id) { $parameters = ['memberId' => (string) $id]; $response = $this->apiClient->doCall('rejoinMemberById', $parameters); // if response is not valid if ($response == 0) { throw new \Exception('Invalid response'); } return (string) $response; }
/** * Send object * This method is used to send a Transactional Message to an email address. * The response indicates whether the send was successful. * * @param string $uniqueIdentifier * @param string $securityTag * @param string $email * @param array $dyn * @param array $content * @param string $type * @param string $sendDate * @param string $uidKey * * @return string * * @throws Exception */ public function sendObject($uniqueIdentifier, $securityTag, $email, array $dyn = null, array $content = null, $type = 'INSERT_UPDATE', $sendDate = null, $uidKey = 'email') { // List of valid type $allowedTypes = ['INSERT', 'UPDATE', 'INSERT_UPDATE', 'NOTHING']; // Check if type is valid if (!in_array($type, $allowedTypes)) { throw new \Exception('Invalid type (' . $type . '), allowed values are: ' . implode(', ', $allowedTypes) . '.'); } $parameters['sendrequest'] = ['email' => (string) $email, 'encrypt' => (string) $securityTag, 'random' => (string) $uniqueIdentifier, 'senddate' => null !== $sendDate ? (int) $sendDate : time(), 'synchrotype' => (string) $type, 'uidkey' => (string) $uidKey]; // Dynamic Personalization Parameters if (null !== $dyn) { foreach ($dyn as $key => $value) { $parameters['sendrequest']['dyn'] = ['entry' => ['key' => $key, 'value' => "<![CDATA[{$value}]]"]]; } } // Content Parameters if (null !== $content) { foreach ($content as $key => $value) { $parameters['sendrequest']['content'] = ['entry' => ['key' => $key, 'value' => "<![CDATA[{$value}]]"]]; } } return (string) $this->apiClient->doCall('sendObject', $parameters); }
/** * Counts the total number of distinct members in a segment (duplicate members are removed). * * @param string $id The ID of the segment. * * @return string The number of members. */ public function segmentationDistinctCount($id) { $parameters = ['id' => (string) $id]; return (string) $this->apiClient->doCall('segmentationDistinctCount', $parameters); }
/** * Get an URL by his order * * @param string $messageId ID of the message. * @param int $order Order of the URL. * * @return array The URL parameters. */ public function getUrlByOrder($messageId, $order) { $parameters = ['messageId' => (string) $messageId, 'order' => (int) $order]; return (array) $this->apiClient->doCall('getUrlByOrder', $parameters); }
/** * Retrieves a banner link by its order number. * * @param string $id The ID of the banner. * @param int $order The order number. * * @return array The Dynamic Content Block link */ public function getBannerLinkByOrder($id, $order) { $parameters = ['bannerId' => (string) $id, 'order' => (string) $order]; return (array) $this->apiClient->doCall('getBannerLinkByOrder', $parameters); }
/** * Upload file merge * This method uploads a file containing members and merges them with those in the member table. * * @param string $fileContent * @param string $filename * @param string $criteria * @param string $mapping * @param string $fileEncoding * @param string $separator * @param boolean $skipFirstLine * @param string $dateFormat * * @return string The ID of the upload job */ public function uploadFileMerge($fileContent, $filename, $criteria, $mapping, $fileEncoding = 'UTF-8', $separator = '|', $skipFirstLine = false, $dateFormat = 'mm/dd/yyyy') { $parameters['file'] = $fileContent; $parameters['mergeUpload'] = array('fileName' => (string) $filename, 'fileEncoding' => (string) $fileEncoding, 'separator' => (string) $separator, 'skipFirstLine' => $skipFirstLine, 'dateFormat' => (string) $dateFormat, 'criteria' => (string) $criteria, 'mapping' => $mapping); return (string) $this->apiClient->doCall('uploadFileMerge', $parameters); }
/** * Retrieves a list of all the trackable links in a banner. * * @param string $id The ID of the banner. * * @return array List of the trackable links. */ public function getAllBannerTrackableLinks($id) { $parameters = ['id' => (string) $id]; return (array) $this->apiClient->doCall('getAllBannerTrackableLinks', $parameters); }
/** * Get the content of the download file * * @param type $fileID The ID of the export request * * @return string */ public function getDownloadFile($fileID) { $parameters = ['id' => (string) $fileID]; return (string) $this->apiClient->doCall('getDownloadFile', $parameters); }
/** * Retrieves a snapshot report. * * @param string $id The id of the campaign. * * @return array The campaign snapshot report data. */ public function getCampaignSnapshotReport($id) { $parameters = ['campaignId' => (string) $id]; return (array) $this->apiClient->doCall('getCampaignSnapshotReport', $parameters); }
/** * Get a list of not validated alternate senders. * * @return array The list of email addresses. */ public function getNotValidatedSenders() { return (array) $this->apiClient->doCall('getNotValidatedSenders'); }
/** * Retrieves a list of test groups. * * @return array The list of groups IDs. */ public function getClientTestGroups() { return (array) $this->apiClient->doCall('getClientTestGroups'); }
/** * Retrieves a link report. * * @param string $campaignId The ID of the campaign * @param int $page The page to return * * @return array The paginated list of link response reports of the campaign. */ public function getLinkReport($campaignId, $page = 1) { $parameters = ['campaignId' => (string) $campaignId, 'page' => (int) $page]; return (array) $this->apiClient->doCall('getLinkReport', $parameters); }