Library for using online Email providers

Related tags

Email Stampie
Overview

Stampie

Stampie have been moved to the "Flint" organization in order to get a better collaborative flow.

Build Status

Stampie is a simple API Wrapper for different email providers such as Postmark and SendGrid.

It is very easy to use and to integrate into your application as demonstrated below with a SendGrid mailer.

Providers

<?php

// Stampie.phar does Autoloading through its Stup.php
require '/path/to/stampie.phar';

class Message extends \Stampie\Message
{
	public function getFrom() { return '[email protected]'; }
	public function getSubject() { return 'You are trying out Stampie'; }
	public function getText() { return 'So what do you think about it?'; }
}

$adapter = new Stampie\Adapter\Buzz(new Buzz\Browser());
$mailer = new Stampie\Mailer\SendGrid($adapter, 'username:password');

// Returns Boolean true on success or throws an HttpException for error
// messages not recognized by SendGrid api or ApiException for known errors.
$mailer->send(new Message('[email protected]'));

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 a Adapter Pattern to integrate with known libraries such as Buzz and Guzzle.

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.

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 recieve it together with html and text bodies.

Last their is an Interface for every type of class or abstract implementation that should be used when adding new Mailer's or Adapter's.

Documentation

There is generated API documentation for all tags and released versions. Those can be found at henrikbjorn.github.com/Stampie/api/master.

Extensions

  • StampieExtra provides extensions to Stampie using the Symfony2 EventDispatcher component.

Framework integration

Stampie is itself completly decoupled and does not depend on any framework.

Integrations

Testing

Stampie is Continuous Integration tested with Travis and aims for a high coverage percentage.

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 aswell.

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.

You might also like...
PHP library for parsing plain text email content.

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

📧 Handy email creation and transfer library for PHP with both text and MIME-compliant support.

📧 Handy email creation and transfer library for PHP with both text and MIME-compliant support.

Mail sending module for Mezzio and Laminas MVC with support for file attachment and template email composition
Mail sending module for Mezzio and Laminas MVC with support for file attachment and template email composition

This module provides an easy and flexible way to send emails from Mezzio and Laminas MVC applications (formerly known as Zend Expressive and Zend MVC). It allows you to pre-configure emails and transports, and then send those emails at runtime.

Omnisend: Ecommerce Email Marketing and SMS Platform

Omnisend Omnisend: Ecommerce Email Marketing and SMS Platform Version v1.x Support all PHP Version =5.6 v2.x Support all PHP Version =7.0 Installati

Sending Email via Microsoft Exchange Web Services made Easy!

Send Mail via Exchange Web Services! Sending Email via Microsoft Exchange Web Services (EWS) made easy! Installation Install via Composer composer req

Mailcoach is a self-hosted email list manager - in a modern jacket.
Mailcoach is a self-hosted email list manager - in a modern jacket.

Welcome to Mailcoach Mailcoach is a self-hosted email list manager - in a modern jacket. It features: Subscribers and lists management Subscribe, doub

An AngularJS / Laravel app - Keyword Based Email forwarder | read/write emails through IMAP
An AngularJS / Laravel app - Keyword Based Email forwarder | read/write emails through IMAP

@MailTree Simple mail forwarder. Based on the specific email body/subject keywords forward mails to the list of predefined users. Install Imap Install

Disposable email address validator for Laravel

Laravel Disposable Email Adds a validator to Laravel for checking whether a given email address isn't originating from disposable email services such

EMAIL, PASSWORD AND USERNAME GENERATOR
EMAIL, PASSWORD AND USERNAME GENERATOR

Email-Generator EMAIL, PASSWORD AND USERNAME GENERATOR Install on desktop : Install XAMPP Added environment variable system path = C:\xampp\php downl

Comments
  • Fix issue that breaks latest SendGrid API rules

    Fix issue that breaks latest SendGrid API rules

    We noticed that sendgrid emails suddenly stopped working and after some investigations, it turned out that when the headers array is empty, the sendgrid API return an invalid json error. To workaround that, only include headers in the parameters when there are actual header values.

    @henrikbjorn please review and merge if this makes sense.

    opened by shyam-habarakada 1
Owner
Henrik Bjørnskov
Henrik Bjørnskov
Stampie is a simple API Wrapper for different email providers such as Postmark and SendGrid.

Stampie Stampie is a simple API Wrapper for different email providers such as Postmark and SendGrid. It is very easy to use and to integrate into your

Stampie 289 Dec 5, 2022
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
Magento 2 Email Catcher or Email Logger Module.

Magento 2 Module Experius email catcher / - logger

Experius 49 Dec 16, 2021
SendPortal - Open-source self-hosted email marketing, subscriber and list management, email campaigns and more

SendPortal includes subscriber and list management, email campaigns, message tracking, reports and multiple workspaces/domains in a modern, flexible and scalable application.

Mettle 1.2k Jan 4, 2023
Cross-language email validation. Backed by a database of over 38 000 throwable email domains.

Cross-language temporary (disposable/throwaway) email detection library. Covers 38038+ fake email providers.

Francois-Guillaume Ribreau 1.4k Jan 9, 2023
Small PHP library to valid email addresses using a number of methods.

Email Validator Small PHP library to valid email addresses using a number of methods. Features Validates email address Checks for example domains (e.g

James Jackson 154 Dec 31, 2022
Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols

Fetch Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols. Installing N.b. A note on Ubuntu 14.04 (probab

Tedious Developments 501 Jan 4, 2023
EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

William Durand 606 Dec 8, 2022
Send email across all platforms using one interface

Send email across all platforms using one interface. Table Of Content Requirements Installation Providers AmazonSES Mailgun Mailjet Mandrill Postmark

Omnimail 329 Dec 30, 2022
The classic email sending library for PHP

PHPMailer – A full-featured email creation and transfer class for PHP Features Probably the world's most popular code for sending email from PHP! Used

PHPMailer 19k Jan 1, 2023