mandrill-mail-merge
v0.2.3
Published
Send a mail merge using your Mandrill account
Downloads
2
Readme
mandrill-mail-merge
Send a mail merge using your Mandrill account
Usage
$ npm install -g mandrill-mail-merge
$ mmerge COMMAND
running command...
$ mmerge (-v|--version|version)
mandrill-mail-merge/0.2.3 darwin-x64 node-v8.10.0
$ mmerge --help [COMMAND]
USAGE
$ mmerge COMMAND
...
Commands
mmerge generate
generate a new mail merge template in the current working directory
USAGE
$ mmerge generate
OPTIONS
-f, --fileName=fileName [default: template.js] the output filename
-h, --help show CLI help
See code: src/commands/generate.ts
mmerge help [COMMAND]
display help for mmerge
USAGE
$ mmerge help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
mmerge run
run a mail merge
USAGE
$ mmerge run
OPTIONS
-d, --dataFile=dataFile path to CSV file with merge data
-h, --help show CLI help
-l, --live use the live API key
-n, --numRows=numRows [default: 3] number of test emails to preview/send (ignored in live mode)
-p, --preview print a randomly-selected test email to STDOUT
-t, --templateFile=templateFile path to .js file that exports a render(row) function
DESCRIPTION
Input files:
==============
Mail merge requires a CSV of merge data, and a matching Javascript template file that exports the following keys:
{
// -- the sender's email address
fromEmail: string,
// -- the sender's name
fromName: string,
// -- function returning the recipient's email address
to: (row) => string,
// -- [optional] function returning the recipient's name
to: (row) => string,
// -- the email subject. A string, or a function that takes a CSV row and returns a string
subject: string | (row) => string,
// -- function that renders the email body from a CSV row
message: (row) => string
}
Note that CSV column headers will be converted to camelCase
See code: src/commands/run.ts
mmerge setconfig
add or remove Mandrill credentials
USAGE
$ mmerge setconfig
OPTIONS
-h, --help show CLI help
See code: src/commands/setconfig.ts