1.0.0 • Published 11 years ago

mandrill-redirect v1.0.0

Weekly downloads
1
License
-
Repository
github
Last release
11 years ago

mandrill-redirect

Redirect emails declared in Mandrill template data to a single developer's/QA's email. Useful during development and testing.

E.g. Given two recipients jack@gmail.com, jill@gmail.com and a redirect email of test@gmail.com the resulting recipients will be test+0@gmail.com and test+1@gmail.com.

##Use

Install via npm install mandrill-redirect

and use:

rewrites a Mandrill template:

to:

Also:

  • to is mandatory and must have length
  • merge_vars is optional but if provided must match the length of to
  • recipient_metadata is optional but if provided must match the length of to
  • If no email is given for redirecting then any template manipulation is skipped.
  • The return value is true/false indicating success/failure. The template is rewritten in place.