Send emails through Postmark using GruntJS. You can use this to test your email templates.
This plugin requires that you have a Postmark account.
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-postmark --save-dev
After the plugin is installed, it can be enabled in your Gruntfile:
grunt.loadNpmTasks('grunt-postmark');
Run this task with the grunt postmark
command.
Your server token can be found on your server’s credentials page on Postmark’s app.
Type: String
This is the from address you are using to send the email. This must be a confirmed address that's set up on Postmark’s sender signatures.
Type: String
The address you’re sending to.
Type: String
Type: String
grunt.initConfig({
postmark: {
email: {
serverToken: 'POSTMARK_API_TEST',
from: 'you@youremail.com',
to: 'you@youremail.com',
subject: 'Yo',
src: ['test/email.html']
}
}
});
Options specified through a target will always take precedence over global options.
grunt.initConfig({
postmark: {
options: {
serverToken: 'POSTMARK_API_TEST',
from: 'you@youremail.com',
to: 'you@youremail.com',
subject: 'Yo'
},
email: {
to: 'joe@youremail.com',
src: ['test/email.html']
},
digest: {
subject: 'Yo',
src: ['test/email.html', 'test/email2.html']
}
}
});