2017 © Pedro Peláez
 

library mail-client

api client for the siteworx professionals api

image

siteworx/mail-client

api client for the siteworx professionals api

  • Thursday, April 5, 2018
  • by alphafloor
  • Repository
  • 0 Watchers
  • 2 Stars
  • 672 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 13 % Grown

The README.md

Mail client for the siteworx pro email API

https://email.siteworxpro.com/api, (*1)

Access to the API is restricted and requires an account., (*2)

composer require siteworx/mail-client, (*3)

Requires PHP >7.0, (*4)

Usage, (*5)

require 'vendor/autoload.php';

$transport = new Siteworx\Mail\Transports\ApiTransport([
    'client_id' => 'k4ndk...4kkfa',
    'client_secret' => 'Jdv4...4kvD'
]);

$client = new Siteworx\Mail\Client($transport);

$client->setSubject('Test Subject');
$client->setFrom('from@email.com');

$client->addTo('an@email.com');
$client->addTo('another@email.com');

$client->setBody('Test Message!');

$result = $client->send();

You can provide a cache to the api transport and your api token will automatically be cached for it's lifetime., (*6)


$memcache = new Memcache; $memcache->addServer($host); $transport = new Siteworx\Mail\Transports\ApiTransport([ 'client_id' => 'k4ndk...4kkfa', 'client_secret' => 'Jdv4...4kvD' ]); $transport->setCache($memcache);

You can use any cache that implements the PSR-6 CacheInterface., (*7)

Catching Message, (*8)

You can catch message if you are testing by passing in the value of true to the send method, (*9)

$client->send(true);

The payload will be sent to the api and validated but will be caught before it is sent., (*10)

Delaying Messages, (*11)

You can delay message so they are sent at a specific time., (*12)

$time = new DateTime();
$time->add(new DateInterval('P1D'));
$client->sendTime($time);

This will send the email the next day., (*13)

The Versions

05/04 2018

dev-master

9999999-dev

api client for the siteworx professionals api

  Sources   Download

MIT

The Requires

 

by Siteworx Pro

05/04 2018

0.5

0.5.0.0

api client for the siteworx professionals api

  Sources   Download

MIT

The Requires

 

by Siteworx Pro

25/09 2017

0.4

0.4.0.0

api client for the siteworx professionals api

  Sources   Download

MIT

The Requires

 

by Siteworx Pro

22/09 2017

0.3

0.3.0.0

api client for the siteworx professionals api

  Sources   Download

MIT

The Requires

 

by Siteworx Pro

20/09 2017

0.2

0.2.0.0

api client for the siteworx professionals api

  Sources   Download

MIT

The Requires

 

by Siteworx Pro

20/09 2017

0.1

0.1.0.0

api client for the siteworx professionals api

  Sources   Download

MIT

The Requires

 

by Siteworx Pro