2017 © Pedro Peláez
 

library stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

image

stampie/stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  • Monday, February 12, 2018
  • by Nyholm
  • Repository
  • 13 Watchers
  • 251 Stars
  • 2,136 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 27 Forks
  • 6 Open issues
  • 30 Versions
  • 21 % Grown

The README.md

Stampie

CI, (*1)

Stampie is a simple API Wrapper for different email providers such as Postmark and SendGrid., (*2)

It is very easy to use and to integrate into your application as demonstrated below with a SendGrid mailer., (*3)

Providers

<?php

// composer autoloading.
require 'vendor/autoload.php';

class Message extends \Stampie\Message
{
    public function getFrom() { return 'alias@domain.tld'; }
    public function getSubject() { return 'You are trying out Stampie'; }
    public function getText() { return 'So what do you think about it?'; }
}

$adapter = new Http\Adapter\Guzzle6\Client();
$mailer = new Stampie\Mailer\SendGrid($adapter, 'username:password');

// Throws an HttpException for error
// messages not recognized by SendGrid api or ApiException for known errors.
$mailer->send(new Message('reciever@domain.tld'));

This simple example shows a few different things about how Stampie works under the hood and is developed. Because others are so much better than us to do HTTP communication, Stampie uses the PSR-18 abstraction so you are free to choose between any library like Buzz or Guzzle. See the full list here: https://packagist.org/providers/psr/http-client-implementation, (*4)

Every mailer takes a $serverToken as the second argument in their constructor. This is what is used for authentication. In the Postmark mailer this is a hash but in SendGrid it is a username:password pattern that is split into two pieces and send as arguments. A mailer is responsible for formatting the request needed for a given API., (*5)

A Message or MessageInterface is a simple storage class that holds information about the message sent to an API such as the email address this is from and who should receive it together with html and text bodies., (*6)

Last there is an interface for every type of class or abstract implementation that should be used when adding new Mailer's or Adapter's., (*7)

Installation

Stampie is not hard coupled to Guzzle or any other library that sends HTTP messages. It uses an abstraction called PSR-18. This will give you the flexibility to choose what PSR-7 implementation and HTTP client to use., (*8)

If you just want to get started quickly you should run the following command:, (*9)

composer require stampie/stampie php-http/curl-client nyholm/psr7

Why requiring so many packages?

Stampie has a dependency on the virtual package psr/http-client-implementation which requires to you install an adapter, but we do not care which one. That is an implementation detail in your application. We also need a PSR-17 implementation., (*10)

You do not have to use the php-http/curl-client if you do not want to. You may use the php-http/guzzle6-adapter or any other library in this list., (*11)

Documentation

There is generated API documentation for all tags and released versions. Those can be found at stampie.github.io/Stampie/api/main/., (*12)

Extensions

  • Stampie Extra provides extensions to Stampie using the Symfony EventDispatcher component.

Framework integration

Stampie is itself completely decoupled and does not depend on any framework., (*13)

Integrations

Testing

Stampie is Continuous Integration tested with GitHub Actions and aims for a high coverage percentage., (*14)

Developing

As mentioned above if integrating new mailers or adapters please rely on the interfaces or abstract classes already in this package. Furthermore unit tests should be provided as well., (*15)

Feedback

This is a project created to test TDD along the way and maybe have some scars from that. But you are always welcome to send feedback or GitHub, Twitter, GitHub issue or Pull Request. Same goes if something is wrong or you have ideas for a better or smarter implementation., (*16)

The Versions

12/02 2018

dev-master

9999999-dev https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

12/02 2018

1.0.0-beta2

1.0.0.0-beta2 https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

12/02 2018

dev-Nyholm-patch-1

dev-Nyholm-patch-1 https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

12/02 2018

dev-analysis-XkpJoj

dev-analysis-XkpJoj https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

05/02 2018

1.0.0-beta1

1.0.0.0-beta1 https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

04/02 2018

dev-stampe-reponse

dev-stampe-reponse https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

30/11 2017

dev-patch-sendgrid-v3

dev-patch-sendgrid-v3 https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

05/08 2017

dev-patch-install

dev-patch-install https://github.com/Stampie/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

21/02 2017

1.0.0-alpha2

1.0.0.0-alpha2 https://github.com/henrikbjorn/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

27/07 2016

1.0.0-alpha1

1.0.0.0-alpha1 https://github.com/henrikbjorn/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

23/09 2015

0.x-dev

0.9999999.9999999.9999999-dev https://github.com/henrikbjorn/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

23/09 2015

0.11.2

0.11.2.0 https://github.com/henrikbjorn/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

23/09 2015

0.11.1

0.11.1.0 https://github.com/henrikbjorn/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

17/05 2015

0.11.0

0.11.0.0 https://github.com/henrikbjorn/Stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

wrapper mandrill sendgrid adapter postmark mailgun

17/05 2015

dev-next-version

dev-next-version

Mailer library that makes it easy to use cloud providers

  Sources   Download

MIT

The Requires

 

The Development Requires

17/07 2014

0.10.0

0.10.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

15/07 2014

0.9.0

0.9.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

03/07 2014

0.8.0

0.8.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

15/01 2013

v0.7.0

0.7.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

17/12 2012

v0.6.0

0.6.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

13/07 2012

v0.5.0

0.5.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

13/07 2012

v0.4.0

0.4.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

19/06 2012

v0.3.0

0.3.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

18/05 2012

v0.2.0

0.2.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

18/05 2012

dev-mailgun

dev-mailgun https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

12/12 2011

v0.1.3

0.1.3.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

The Requires

  • php >=5.3.8

 

09/12 2011

v0.1.2

0.1.2.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

06/12 2011

v0.1.1

0.1.1.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

05/12 2011

v0.1.0

0.1.0.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT

01/12 2011

v0.0.1

0.0.1.0 https://github.com/henrikbjorn/Stampie

A Postmarkapp API Mailer

  Sources   Download

MIT