Publish email templates though mandrill as part of your build.
This is being hastily deployed for internal consumption. You probably shouldn't use this yet.
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-mandrill-template --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-mandrill-template');
We have a build pipeline that compiles jade and sass into inline-styled HTML pages for email msgs. We then need to publish them
Run this task with the grunt mandrilltemplate
command.
From https://mandrillapp.com/api/docs/templates.nodejs.html
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Type: String
Your Mandrill API key
Type: String
The 'from' address. Acceptable domains may be restricted by your mandrill account settings
Type: String
The 'from' display name.
Type: String
The subject of your email. Leave blank to load from the HTML <title> tag.
Type: String
If no files are specified in src:
, the mandrill task will send a plaintext email
using body
for the msg content.
Type: String
a default text part to be used when sending with this template
Type: Boolean
set to false to add a draft template without publishing
Type: Array
an optional array of up to 10 labels to use for filtering templates
src:
is one or more files to be used as an email body. A new email will be sent for each file.
module.exports = function(grunt){
grunt.initConfig({
mandrilltemplate: {
server: {
src: ['output/*.html'],
filter: 'isFile',
options: {
key: '',
from_email: '',
from_name: '',
subject: '',
text: '',
publish: true,
labels: ['autogen']
}
}
})
});
grunt.loadNpmTasks('grunt-mandrill-template');
});