If nodemailer
has been defined globally we use that. This allows us to
easily replace nodemailer
with a mockup when running tests.
Default options.
Send a single email message.
Check if errors so far contain fatal errors. If so we won't retry.
Set default sender if exists as transport option.
TODO: msg.subject = // get page title using cheerio...
Render a message object before sending.
Render both html
and txt
templates. If files are not found...?
If template is already cached no need to re-compile.
Compile a Handlebars template from file. If file doesn't exist or can not be read no error will be raised. The callback will be invoked passing a dummy template function that does nothing. NOTE: callback will be invoked with only one argument as no errors can be raised.
Horseshoe