This commit is contained in:
Tomas Bures 2018-09-27 23:37:50 +02:00
parent 1448d9e914
commit bc818aaee2
11 changed files with 35 additions and 27 deletions

View file

@ -226,7 +226,7 @@ async function _createTransport(sendConfiguration) {
transport.mailer = {
throttleWait: bluebird.promisify(throttleWait),
sendTransationalMail: async (mail, template) => await _sendTransactionalMail(transport, mail, template),
sendTransactionalMail: async (mail, template) => await _sendTransactionalMail(transport, mail, template),
sendMassMail: async (mail, template) => await _sendMail(transport, mail)
};

View file

@ -1,6 +1,6 @@
'use strict';
const log = require('./log');
const log = require('npmlog');
const fields = require('../models/fields');
const settings = require('../models/settings');
const {getTrustedUrl} = require('./urls');
@ -128,7 +128,7 @@ async function _sendMail(list, email, template, subject, relativeUrls, subscript
type: 'mjml'
};
if (list.default_form !== null) {
if (list.default_form) {
const form = await forms.getById(contextHelpers.getAdminContext(), list.default_form);
text.template = form['mail_' + template + '_text'] || text.template;

View file

@ -40,7 +40,7 @@ async function getTemplate(template) {
}
if (template.type === 'mjml') {
const compiled = mjml.mjml2html(source);
const compiled = mjml(source);
if (compiled.errors.length) {
throw new Error(compiled.errors[0].message || compiled.errors[0]);