PHPackages                             seewah/mandrill-template-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. seewah/mandrill-template-manager

ActiveLibrary[Templating &amp; Views](/categories/templating)

seewah/mandrill-template-manager
================================

Utility class for generating and publishing Mandrill templates

v1.0.2(12y ago)7321MITPHPPHP &gt;=5.3.0

Since Aug 1Pushed 12y ago1 watchersCompare

[ Source](https://github.com/seewah/mandrill-template-manager)[ Packagist](https://packagist.org/packages/seewah/mandrill-template-manager)[ Docs](https://github.com/seewah/mandrill-template-manager)[ RSS](/packages/seewah-mandrill-template-manager/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

mandrill-template-manager
=========================

[](#mandrill-template-manager)

A PHP utility class for generating and publishing Mandrill templates.

Why?
----

[](#why)

I am a fan of the [Mandrill](http://mandrill.com) 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:

- 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](http://mustache.github.com/) as the templating language.

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.

Usage
-----

[](#usage)

As Mandrill Template Manager has been packaged up as a [Composer](http://getcomposer.org/) package, the easiest way to start using the class is to [install Composer and use the autoloader](http://getcomposer.org/doc/00-intro.md).

A quick example:

```
