From 20603f679cb0b6d306324ada3472bddb2f6cbcd3 Mon Sep 17 00:00:00 2001 From: "amit.kumar" Date: Wed, 19 Jun 2019 15:55:39 +0530 Subject: [PATCH] allow attachments from api --- server/lib/template-sender.js | 3 ++- server/routes/api.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/lib/template-sender.js b/server/lib/template-sender.js index 534df7fe..5fda749f 100644 --- a/server/lib/template-sender.js +++ b/server/lib/template-sender.js @@ -48,7 +48,8 @@ class TemplateSender { return mailer.sendTransactionalMail( { to: options.email, - subject + subject, + attachments: options.attachments || [] }, { html: { template: html }, diff --git a/server/routes/api.js b/server/routes/api.js index ebb822e4..943f1fac 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -308,7 +308,8 @@ router.postAsync('/templates/:templateId/send', async (req, res) => { email: input.EMAIL, sendConfigurationId: input.SEND_CONFIGURATION_ID, subject: input.SUBJECT, - variables: input.VARIABLES + variables: input.VARIABLES, + attachments: input.ATTACHMENTS || [] }); res.status(200).json({ data: info }); } catch (e) {