Bugfixing.

This commit is contained in:
Tomas Bures 2018-09-27 12:34:54 +02:00
parent 86efa11994
commit 5670d21e76
31 changed files with 241 additions and 216 deletions

View file

@ -9,6 +9,10 @@ const premailerPrepareAsync = bluebird.promisify(premailerApi.prepare);
const router = require('../../lib/router-async').create();
router.postAsync('/html-to-text', passport.loggedIn, passport.csrfProtection, async (req, res) => {
if (!req.body.html) {
return res.json({text: ''}); // Premailer crashes very hard when html is empty
}
const email = await premailerPrepareAsync({
html: req.body.html,
fetchHTML: false