From 20603f679cb0b6d306324ada3472bddb2f6cbcd3 Mon Sep 17 00:00:00 2001 From: "amit.kumar" Date: Wed, 19 Jun 2019 15:55:39 +0530 Subject: [PATCH 1/2] 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) { From deb6f1f294119ec12a9c0577bf645771c83d2698 Mon Sep 17 00:00:00 2001 From: Tomas Bures Date: Wed, 26 Jun 2019 18:10:21 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9085c274..3f2e3362 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,11 @@ This setup starts a stack composed of Mailtrain, MongoDB, Redis, and MariaDB. It - http://localhost:3003 - sandbox endpoint - http://localhost:3004 - public endpoint -To make this publicly accessible, you should add reverse proxy that makes these endpoints publicly available over HTTPS. +To make this publicly accessible, you should add reverse proxy that makes these endpoints publicly available over HTTPS. If using the proxy, you also need to set the URL bases and `--withProxy` parameter via `MAILTRAIN_SETTING` as shown below. +An example of such proxy would be: +- http://localhost:3000 -> https://mailtrain.example.com +- http://localhost:3003 -> https://sbox.mailtrain.example.com +- http://localhsot:3004 -> https://lists.example.com To deploy Mailtrain with Docker, you need the following three dependencies installed: