First take on the "send from url" feature

This commit is contained in:
Andris Reinman 2016-04-26 19:07:07 +03:00
parent d8b98d2a8b
commit e4c71f4026
9 changed files with 190 additions and 117 deletions

View file

@ -9,6 +9,7 @@ let Handlebars = require('handlebars');
let fs = require('fs');
let path = require('path');
let templates = new Map();
let htmlToText = require('html-to-text');
module.exports.transport = false;
@ -54,6 +55,10 @@ module.exports.sendMail = (mail, template, callback) => {
if (textRenderer) {
mail.text = textRenderer(template.data || {});
} else if (mail.html) {
mail.text = htmlToText.fromString(mail.html, {
wordwrap: 130
});
}
module.exports.transport.sendMail(mail, callback);