Peytz Mail SDK
==============

This is a PHP SDK for making **Peytz Mail API** easy to use.

Implementation
--------------

- [X] Subscriber Methods
- [X] Mailinglist Methods
- [-] Newsletter Methods (partial)
- [X] Trigger mail Methods
- [ ] User Methods
- [ ] User Groups Methods
- [ ] Content Feeds
- [ ] Feeds
- [X] Subscriber events
- [X] Subscriber field events
- [X] Tracking events
- [ ] Unsubscribe callback


Login to Customer's Peytz Mail
------------------------------

Ask an administrator to create your account before trying to login.

1. Visit: http://{customer}.peytzmail.com/
2. Use your Peytz email as username
3. Use your Peytz email password as password


Peytz Mail documentation
------------------------

Visit: http://{customer}.peytzmail.com/api/v1/documentation


Getting started
---------------

The only requirement is the installation of SSH keys for a git client.

Install Composer:

``` bash
$ curl -sS https://getcomposer.org/installer | php
```

Add to your `composer.json` file:

``` json
{
    "repositories" : [
        {
            "type" : "composer",
            "url"  : "http://baggagist.flex.peytz.dk:"
        }
    ],

    "require" : {
        "flex/peytz-mail-sdk": "~0.3"
    }
}
```

Then

``` bash
$ composer install
```

Changelog
---------

See the [changelog](CHANGELOG.md).


Usage
-----

``` php
require 'vendor/autoload.php';

use PeytzMail\Config;
use PeytzMail\Client;
use PeytzMail\PeytzMail;

$config = new Config('customerName', 'apiKey');
$client = new Client\BuzzClient($config);
$peytzMail = new PeytzMail($client);

try {
    $subscriber = $peytzMail->getSubscriber('the-subscriber-id');
    // ... It will return a Subscriber entity
} catch (\Exception $e) {
    printf('Exception: %s', $e->getMessage());
}
```


API
---

Coming soon...


Running Tests
-------------

``` bash
$ composer install --dev
$ ./vendor/bin/phpunit
```

Dependencies
------------

| Project            | License                       | Documentation                                                |
| ------------------ | ----------------------------- | ------------------------------------------------------------ |
| PHP                | The PHP License, version 3.01 | http://php.net                                               |
| PHPUnit            | BSD-3                         | http://phpunit.de/                                           |
| Buzz               | MIT                           | https://github.com/kriswallsmith/Buzz                        |
