Exemplo n.º 1
0
 /**
  * Get group fields
  *
  * @param integer $id Id of the group
  * @return array Request result
  * @throws \Exception
  */
 public function get($id)
 {
     $request = new Request('customizations');
     $request->setIdParam(urlencode($id));
     $response = $this->client->get($request);
     $this->assertSuccessResponse($response);
     return $response->getData();
 }
Exemplo n.º 2
0
 /**
  * Get campaign statistics.
  *
  * @link https://rule.se/apidoc/#campaigns-get-statistics-get
  *
  * @param integer $id Id of the campaign.
  * @return array Request result
  * @throws \Exception
  */
 public function statistics($id)
 {
     $request = new Request('campaigns');
     $request->setIdParam($id);
     $request->addSubresource(['name' => 'statistics']);
     $response = $this->client->get($request);
     $this->assertSuccessResponse($response);
     return $response->getData();
 }
Exemplo n.º 3
0
 /**
  * Get template by id
  *
  * @link https://rule.se/apidoc/#templates-get-template-get
  *
  * @param $id
  * @return array
  * @throws \Exception
  */
 public function get($id)
 {
     $this->assertValidTemplateId($id);
     $request = new Request('templates');
     $request->setIdParam($id);
     $response = $this->client->get($request);
     $this->assertSuccessResponse($response);
     return $response->getData();
 }
Exemplo n.º 4
0
 /**
  * Clear associations between subscriber and tag
  *
  * @link https://rule.se/apidoc/#tags-clear-tag-delete
  *
  * @param $id
  * @return array
  * @throws \Exception
  */
 public function clear($id)
 {
     $request = new Request('tags');
     $request->setIdParam(urlencode($id));
     $request->addSubresource(['name' => 'clear']);
     $response = $this->client->delete($request);
     $this->assertSuccessResponse($response);
     return $response->getData();
 }
Exemplo n.º 5
0
 /**
  * Removes subscriber tags
  *
  * @link https://rule.se/apidoc/#subscribers-delete-subscriber-tag-delete
  *
  * @param $id
  * @param $tag
  * @param string $identifyBy
  * @return array
  * @throws \Exception
  */
 public function deleteTag($id, $tag, $identifyBy = "email")
 {
     $request = new Request('subscribers');
     $request->setQuery(['identified_by' => $identifyBy]);
     $request->setIdParam($id);
     $request->addSubresource(['name' => 'tags', 'id' => urlencode($tag)]);
     $response = $this->client->delete($request);
     $this->assertSuccessResponse($response);
     return $response->getData();
 }