Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning confirmation that the email has been sent #68

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions backend/src/email.js
Original file line number Diff line number Diff line change
@@ -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;
}
}

Expand Down Expand Up @@ -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 = {
Expand Down