Fixes. Reimplementation of the API transaction sender.

This commit is contained in:
Tomas Bures 2019-07-16 21:03:37 +05:30
parent a22187ef12
commit 8606652101
13 changed files with 350 additions and 276 deletions

View file

@ -310,11 +310,14 @@ router.postAsync('/templates/:templateId/send', async (req, res) => {
}
const emails = input.EMAIL.split(',');
const mergeTags = input.TAGS || {};
const subject = input.SUBJECT || '';
const attachments = input.ATTACHMENTS || [];
// TODO: attachments: input.ATTACHMENTS || []
const info = await templates.sendAsTransactionalEmail(req.context, templateId, sendConfigurationId, emails, input.SUBJECT, input.VARIABLES);
res.json({ data: info });
const result = await templates.sendAsTransactionalEmail(req.context, templateId, sendConfigurationId, emails, subject, mergeTags, attachments);
res.json({ data: result });
});
module.exports = router;