Bugfixing.
This commit is contained in:
parent
86efa11994
commit
5670d21e76
31 changed files with 241 additions and 216 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue