Send test functionality for templates and campaigns
This commit is contained in:
parent
7e52000219
commit
2c73c536b7
22 changed files with 719 additions and 69 deletions
|
@ -5,6 +5,7 @@ const templates = require('../../models/templates');
|
|||
|
||||
const router = require('../../lib/router-async').create();
|
||||
const {castToInteger} = require('../../lib/helpers');
|
||||
const CampaignSender = require('../../lib/campaign-sender');
|
||||
|
||||
|
||||
router.getAsync('/templates/:templateId', passport.loggedIn, async (req, res) => {
|
||||
|
@ -34,4 +35,10 @@ router.postAsync('/templates-table', passport.loggedIn, async (req, res) => {
|
|||
return res.json(await templates.listDTAjax(req.context, req.body));
|
||||
});
|
||||
|
||||
router.postAsync('/template-test-send', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
const data = req.body;
|
||||
const result = await CampaignSender.testSend(req.context, data.listCid, data.subscriptionCid, data.campaignId, data.sendConfigurationId, data.html, data.text);
|
||||
return res.json(result);
|
||||
});
|
||||
|
||||
module.exports = router;
|
Loading…
Add table
Add a link
Reference in a new issue