2017 © Pedro Peláez
 

library coyote

Email and SMS abstraction layer

image

aztech/coyote

Email and SMS abstraction layer

  • Monday, February 23, 2015
  • by thibaud-evaneos
  • Repository
  • 1 Watchers
  • 1 Stars
  • 93 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

coyote

Build Status Scrutinizer Code Quality Coverage Status HHVM Support, (*1)

License Latest Stable Version, (*2)

Coyote is a library to send emails and text messages with support for multiple provides, (*3)

Setup

Install the library

Composer is the only supported way of installing Coyote. From the root of your project, run the following command:, (*4)

composer require aztech/coyote

Pick a provider

Coyote is only an abstraction layer on top of existing SDK's, and by default, does not include those in order to avoid loading too many packages in your project., (*5)

Here's the list of the required packages to be able to use each provider:, (*6)

For email

  • Mandrill: composer require mandrill/mandrill:~1.0
  • Mailgun: composer require mailgun/mailgun:~1.7

For text messages

  • Twilio: composer require twilio/sdk:~3.12

Features

  • Send transactional emails
  • Build messages using local or remote (ie. Mandrill/Mailchimp templates) message templates
  • Send text messages
  • Optional integration with Phinject DI container

Usage

Send emails


use \Aztech\Coyote\Email\Address; use \Aztech\Coyote\Email\Message; use \Aztech\Coyote\Email\Provider\MailgunFactory; require_once 'vendor/autoload.php'; $factory = new MailgunFactory(); $provider = $factory->buildProvider([ 'key' => 'MAILGUN_APIKEY', 'domain' => 'mydomain.com' ]); $message = new \Aztech\Coyote\Email\Message(); $message->addRecipient(new Address('email@domain.com'); $message->setTitle('News'); $message->setBody('Hello, how are you ?'); $provider->send($message);

The Versions

12/02 2015