/** * * @return string API key */ public function regenerateApiKey() { $request = Request::put("{$this->getCompanyId()}"); $response = $this->getConnector()->sendRequest($request); $apiKeyEntity = new ApiKeyEntity($response->getContent()); return $apiKeyEntity->getApiKey(); }
/** * * @param NotificationEntity $notification * @param int $notificationId */ public function updateNotification(NotificationEntity $notification, $notificationId) { $request = Request::put("{$this->getCompanyId()}/notifications/{$notificationId}"); $request->setContentAsEntity($notification); $this->getConnector()->sendRequest($request); }
/** * @param $campaignId * @return CampaignEntity */ public function getCampaign($campaignId) { $request = Request::put("{$this->getCompanyId()}/campaigns/{$campaignId}"); $response = $this->getConnector()->sendRequest($request); return new CampaignEntity($response->getContent()); }
/** * * @param SmsNotificationEntity $smsNotification */ public function updateSmsNotification(SmsNotificationEntity $smsNotification) { $request = Request::put("{$this->getCompanyId()}/sms-notifications/{$smsNotification->getId()}"); $request->setContentAsEntity($smsNotification); $this->getConnector()->sendRequest($request); }
/** * * @param string $email */ public function globalUnsubscribe($email) { $request = Request::put("{$this->getCompanyId()}/unsubscribers/{$email}"); $this->getConnector()->sendRequest($request); }
/** * * @param NewsletterEntity $newsletter * @return NewsletterEntity */ public function updateNewsletter(NewsletterEntity $newsletter) { $request = Request::put("{$this->getCompanyId()}/newsletters/{$newsletter->getId()}"); $request->setContentAsEntity($newsletter); $this->getConnector()->sendRequest($request); }
/** * * @param string $email * @param int $recipientsListId * @return UnsubscriberEntity */ public function getRecipientListUnsubscriber($email, $recipientsListId) { $request = Request::put("{$this->getCompanyId()}/recipients-lists/{$recipientsListId}/unsubscribers/{$email}"); $response = $this->getConnector()->sendRequest($request); return new UnsubscriberEntity($response->getContent()); }