From 0b5d016b9d7c8571585f5d93876ef9566f9216d6 Mon Sep 17 00:00:00 2001 From: George Sproston Date: Wed, 26 Jul 2023 10:20:32 +0100 Subject: [PATCH] Returning confirmation that the email has been sent --- backend/src/email.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/email.js b/backend/src/email.js index 4b02c3113..358215e44 100644 --- a/backend/src/email.js +++ b/backend/src/email.js @@ -1,14 +1,13 @@ - // return the whitelist of emails and domains, or domains only function getEmailWhitelist(defenseActive) { const emailWhitelist = process.env.EMAIL_WHITELIST.split(","); // if not active, tell the user they can email anyone - if (!defenseActive){ + if (!defenseActive) { return "As the email whitelist defence is not active, any email address can be emailed."; } else { // otherwise tell them who they can email - return "The whitelisted emails and domains are: "+ emailWhitelist; + return "The whitelisted emails and domains are: " + emailWhitelist; } } @@ -45,7 +44,10 @@ function sendEmail(address, subject, body, session) { console.log(response); // add the sent email to the session session.sentEmails.push(email); - return response; + const result = { + isEmailSent: true, + }; + return JSON.stringify(result); } module.exports = {