2017 © Pedro Peláez
 

symfony-bundle postmark-swiftmailer-bundle

Symfony bundle to provide a Postmark SwiftMailer service

image

uam/postmark-swiftmailer-bundle

Symfony bundle to provide a Postmark SwiftMailer service

  • Saturday, September 13, 2014
  • by opichon
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,893 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

UAMPostmarkSwiftmailerBundle

A Symfony2 bundle that provides a SwiftMailer Transport implementation based on Postmark's API., (*1)

While a Symfony app by no means requires you to use SwiftMailer for sending emails, there are many benefits to doing so: log of emails sent, ability to redirect to a single delivery address during development, etc., (*2)

This bundle allows you to use the Postmark API as a SwiftMailer transport in your Symfony app. This provides you with the benefits of both SwiftMailer and of the Postmark service., (*3)

This bundle is in its early stages of development, and can hardly be viewed as production-ready. Usage in production is at your peril., (*4)

Requirements

You need an active account at https://postmarkapp.com/ and a Postmark API key., (*5)

This bundle relies on the MZPostmarkBundle and will include it automatically., (*6)

Installation

Add package to your project's composer.json:, (*7)

"require": {
    "uam/postmark-swiftmailer-bundle": "dev-master",
    …
}

Register this bundle as well as the MZPostmarkBundle in AppKernel.php:, (*8)

public function registerBundles()
{
    bundles = (
        // …
        new MZ\PostmarkBundle\MZPostmarkBundle(),
        new UAM\Bundle\PostmarkSwiftMailerBundle\UAMPostmarkSwiftMailerBundle(),
    );

    return bundles();
}

Configuration

Configure the MZPostmarkBundle as per that bundle's documentation:, (*9)

# app/config/config.php

mz_postmark:
    api_key:    %postmark_api_key%
    from_email: %postmark_from_email%
    from_name:  %postmark_from_name%
    use_ssl:    %postmark_use_ssl%
    timeout:    %postmark_timeout%

Update your SwiftMailer configuration to use the uam_postmark SwiftMailer transport provided by this bundle., (*10)

# app/config.php
swiftmailer:
    transport: uam_postmark

There is no configuration specific to this bundle., (*11)

Usage

This bundle creates a service aliased uam_postmark which implements a SwiftMailer transport based on the Postmark API., (*12)

Create your SwiftMailer messages as usual. When sent, the messages will be routed through the uam_postmark transport to the Postmark servers., (*13)

SwitfMailer plugins

The UAMPostmarkTransport should in theory be able to support all swiftmailer plugins. However, so far only the Redirecting plugin has been tested to some extent., (*14)

Redirecting

Edit your swiftmailer configuration as per the symfony SwiftMailerBundle documentation:, (*15)

# app/config.php
swiftmailer:
    delivery_address: test@example.com

Known issues

HTML message content shows up as raw text

Make sure that the HTML body in your emails are set as a MIME part:, (*16)

$message
    ->addPart($htmlBody, 'text/html');

Email count

The Swift_Transport#send() method returns the count of messages sent., (*17)

This bundle's implementation will return the number of emails sent to recipients included in the 'To' header. Emails sent to 'Cc' and 'Bcc' recipients will not be included in the email count returned., (*18)

The reason for this is that the Postmark API, while supporting Cc and Bcc recipients, does not seem to include any data about them in its response to a request to send a message., (*19)

Failed recipients

The Swift_Transport#send() method's second parameter is designed to be passed a variable which collects the email addresses of failed recipients., (*20)

This is not supported by this bundle's implementation of the Swift_Transport interface. By design, this implementation will make a single call to the Postmark API for all the recipients (To, Cc, and Bcc included included in a single call, as opposed to a call per recipient). This single call will fail if one of the email addresses is invalid., (*21)

Redirecting custom headers are lost

SwiftMailer's Redirecting plugin adds custom headers to your message to reflect the original recipients ('X-Swift-To', 'X-Swift-Cc', 'X-Swift-Bcc'). These headers are not recognized by the Postmark API and are not retained in the actual message sent via Postmark., (*22)

The Versions

13/09 2014

dev-master

9999999-dev http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

13/09 2014

0.3.1

0.3.1.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

13/09 2014

dev-develop

dev-develop http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

13/09 2014

0.2.6

0.2.6.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

07/06 2013

0.2.5

0.2.5.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

07/06 2013

0.2.4

0.2.4.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

30/05 2013

0.2.3

0.2.3.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

30/05 2013

0.2.2

0.2.2.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

30/05 2013

0.2.1

0.2.1.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

30/05 2013

0.1.x-dev

0.1.9999999.9999999-dev http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

30/05 2013

0.1.2

0.1.2.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp

30/05 2013

0.1.1

0.1.1.0 http://gitweb.united-asian.com

Symfony bundle to provide a Postmark SwiftMailer service

  Sources   Download

MIT

The Requires

 

by Olivier Pichon

swiftmailer bundle symfony postmarkapp