Skip to content

pepotech/pepocampaigns-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

PepoCampaigns PHP client

PHP client for PepoCampaigns REST API. For details about the API, documentation and examples please visit: https://know.pepocampaigns.com/categories/api/

Requirements

  • PHP 5.4 or higher
  • openssl 1.0.1
  • TLS 1.2 protocol is recommended

Usage

Initiation

require ("PepoCampaigns.class.php");

// key and secret to be passed while initiation
$pepo_campaigns = new PepoCampaigns(array(
	'key' => '3gd68b470d1205bd57fd4dbfa1208ab1',
    'secret' => 'e74c748409db3fae8add716fbeb315a2'
));

Example API Calls

Creating a new list

$pepo_campaigns->create_list(array(
	'name' => 'test list2', 
	'source' => 'My Pepo Campaigns Test List2'
));

Adding a contact to a List

$pepo_campaigns->add_contact_to_list(419,
	array(
    	'email' => 'vpuui.skbbx21@gmail.com', 
    	'first_name' => 'Test2', 
    	'last_name' => 'Test2'
	)
);

Removing a contact from a list

$pepo_campaigns->remove_contact_from_list(419,
	array(
		'email' => 'lcoqw.rymyo10@gmail.com'
	)
);

Changing User Status

$pepo_campaigns->change_user_status(array(
	'email' => 'vpuui.skbbx21@gmail.com', 
	'type' => 'unsubscribe'
));

Send Transactional Email

$pepo_campaigns->send_transactional_email('vpuui.skbbx21@gmail.com', 'welcome', 
	array(
		'a' => 1, 
		'b' => 2, 
		'c' => array('d' => 3, 'e' => 4)
	)
);

License

MIT License