Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.03 KB

readme.md

File metadata and controls

66 lines (47 loc) · 1.03 KB

Ecomail API for Nette

Easy implementation of Ecomail.app API

Requirements

  • Nette 2.3 or above

Instalation

Install with composer.json:

	"require": {
		"haltuf/ecomail-nette": "dev-master"
	}

or

composer require haltuf/ecomail-nette:@dev

Usage

Add following to config.neon:

extensions:
	ecomail: Ecomail\Extension

ecomail:
	key: YOUR_KEY_HERE

And inject service into Presenter:

	/** @var \Ecomail\Ecomail @inject */
	public $ecomail;

Then you can use:

	// get all lists
	$this->ecomail->getLists();

	// get list
	$this->ecomail->getList(1);

	// get subscribers with pagination (20)
	$this->ecomail->getSubscribers(1, $page);

	// get subscriber from list with ID 1
	$this->ecomail->getSubscriber(1, '[email protected]');

	// create or update subscriber
	$this->ecomail->addSubscriber(1, array('email' => '[email protected]', FALSE, TRUE, TRUE));

	// delete subscriber
	$this->ecomail->deleteSubscriber(1, '[email protected]');