2017 © Pedro Peláez
 

library mandrill-template-manager

Utility class for generating and publishing Mandrill templates

image

seewah/mandrill-template-manager

Utility class for generating and publishing Mandrill templates

  • Wednesday, August 28, 2013
  • by seewah
  • Repository
  • 1 Watchers
  • 7 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

mandrill-template-manager

A PHP utility class for generating and publishing Mandrill templates., (*1)

Why?

I am a fan of the Mandrill service. With its template support, we can iterate on email content and layout with relative ease. However, to generate templates, there are a number of steps involved in the workflow, which can be quite manual and errors can easily occur:, (*2)

  • combining different html files (header, footer, etc) together to build the complete html
  • inlining css
  • copy and pasting final html and plain text into Mandrill

So I set out to create a tool to automate all these for me. I chose Mustache as the templating language., (*3)

In addition to being able to "include" templates ("Mustache partials"), I want to be able to use variables in my templates that do not come from the server. For example, we store images on Amazon S3. Instead of hardcoding the S3 host everywhere in my templates, I want to be able to store the host as a variable and reference the variable in my templates., (*4)

Usage

As Mandrill Template Manager has been packaged up as a Composer package, the easiest way to start using the class is to install Composer and use the autoloader., (*5)

A quick example:, (*6)

<?php
$m = new \SeeWah\MandrillTemplateManager\MandrillTemplateManager;
$m->generate('{{> header}}<a href="{{siteUrl}}{{> footer}}">Welcome</a>', $partials, array('siteUrl' => 'http://seewah.com'), $css);
$m->publish($mandrillKey, 'template name', 'no-reply@seewah.com', 'See Wah', 'Getting started', false);

For a more complete example, check out the example to see how you may want to use the class in real life., (*7)

Adding to your own project

Use Composer, of course!, (*8)

The Versions

28/08 2013

dev-master

9999999-dev https://github.com/seewah/mandrill-template-manager

Utility class for generating and publishing Mandrill templates

  Sources   Download

MIT

The Requires

 

The Development Requires

email template mandrill

23/08 2013

v1.0.2

1.0.2.0 https://github.com/seewah/mandrill-template-manager

Utility class for generating and publishing Mandrill templates

  Sources   Download

MIT

The Requires

 

The Development Requires

email template mandrill

02/08 2013

v1.0.1

1.0.1.0 https://github.com/seewah/mandrill-template-manager

Utility class for generating and publishing Mandrill templates

  Sources   Download

MIT

The Requires

 

The Development Requires

email template mandrill

01/08 2013

v1.0.0

1.0.0.0 https://github.com/seewah/mandrill-template-manager

Utility class for generating and publishing Mandrill templates

  Sources   Download

MIT

The Requires

 

The Development Requires

email template mandrill