Skip to content

ybrodsky/CakePHP-2-EmailManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

CakePHP 2 EmailManager

CakePHP 2 Behavior to interact with the EmailManager API

Usage

Define the basic configuration

  Configure::write('EmailManager', array(
	  'config' => array(
  		'domain' => 'YOUR_DOMAIN',
  		'username' => 'YOUR_USERNAME',
  		'password' => 'YOUR_PASSWORD',
  		'output' => 'php',
  		'language' => 'en_US | es_ES'    //Optional 
	  )	
));

Assign the behavior to your model

  public $actsAs = array('EmailManager');

To interact with the api we simply call 'callMethod'. The first parameter is the API method you want to call, the second parameter is an array with options.

  $res = $this->Model->callMethod('campaigns', array(
    'parent_id' => '10'
  ));
  $res = $this->Model->callMethod('contacts', array(
    'date_begin' => '2015-01-01', 
    'limit' => 10
  ));
  $res = $this->Model->callMethod('contactCreate', array(
    'name' => 'TehName TehSurname', 
    'email' => 'email@mail.com',
    'group_id' => 10
  ));

A full list of the methods can be found in EmailManager's API official documentation.

About

CakePHP 2 Behavior to interact with the EmailManager API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages