Included MJML4
This commit is contained in:
parent
e2093e22fe
commit
9f467762c0
18 changed files with 15949 additions and 3889 deletions
|
@ -9,7 +9,10 @@ const {getPublicUrl} = require('./urls');
|
|||
const bluebird = require('bluebird');
|
||||
|
||||
const hasher = require('node-object-hash')();
|
||||
|
||||
const mjml = require('mjml');
|
||||
const mjml2html = mjml.default;
|
||||
|
||||
const hbs = require('hbs');
|
||||
const juice = require('juice');
|
||||
let he = require('he');
|
||||
|
@ -40,7 +43,7 @@ async function getTemplate(template) {
|
|||
}
|
||||
|
||||
if (template.type === 'mjml') {
|
||||
const compiled = mjml(source);
|
||||
const compiled = mjml2html(source);
|
||||
|
||||
if (compiled.errors.length) {
|
||||
throw new Error(compiled.errors[0].message || compiled.errors[0]);
|
||||
|
@ -136,7 +139,7 @@ function formatMessage(campaign, list, subscription, mergeTags, message, filter,
|
|||
});
|
||||
}
|
||||
|
||||
async function prepareHtml(html) {
|
||||
async function prepareHtml(html) {
|
||||
if (!(html || '').toString().trim()) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue