dispatch:emissary-transport-mandrill

v0.11.1Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Mandrill Transport

Send an email notification using the Mandrill API

Setup

Note: You need a Mandrill account to use this package

Add the package as a dependency of another package:

1api.use(['dispatch:emissary-transport-mandrill'], 'server');

Or just use it in your root application:

$ meteor add dispatch:emissary-transport-mandrill

Usage

Configuration/Working the Queue

1var transport = new MandrillTransport({
2  key:'<Mandrill API key>',
3  fromEmail:'no-reply@mycompany.com',
4  fromName:'My Company'
5});
6
7transport.register();

The above will create a new Mandrill transport and register it to work "email" messages in the Emissary job queue.

Queueing Messages

The body template functions a bit different than other transports. Mandrill let's you define templates in their interface, so instead of being the raw Handlebars template, bodyTemplate in this case is the name of the template in Mandrill.

Note that at the moment, this package only supports Handlebars as the merge language.

1Emissary.queueTask('email', {
2  bodyTemplate:'<Mandrill template name>',
3  subjectTemplate:'<subject handlebars template>',
4  templateData:{},
5  transportConfig:{
6    to:'person@email.com'
7  }
8})