Skip to content
Snippets Groups Projects
Commit 40a55c45 authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

feat(component-mail-service): add email sending property in config

parent b9a04f75
No related branches found
No related tags found
1 merge request!10Sprint #12
...@@ -4,6 +4,7 @@ const helpers = require('./helpers/helpers') ...@@ -4,6 +4,7 @@ const helpers = require('./helpers/helpers')
const resetPasswordPath = config.get('invite-reviewer.url') const resetPasswordPath = config.get('invite-reviewer.url')
const resetPath = config.get('invite-reset-password.url') const resetPath = config.get('invite-reset-password.url')
const emailSending = config.get('email-sending')
module.exports = { module.exports = {
sendSimpleEmail: async ({ sendSimpleEmail: async ({
...@@ -130,7 +131,8 @@ module.exports = { ...@@ -130,7 +131,8 @@ module.exports = {
text: textBody, text: textBody,
html: htmlBody, html: htmlBody,
} }
return Email.send(mailData) if (emailSending === 'true') return Email.send(mailData)
return {}
}, },
sendReviewerInvitationEmail: async ({ sendReviewerInvitationEmail: async ({
user, user,
...@@ -246,7 +248,8 @@ module.exports = { ...@@ -246,7 +248,8 @@ module.exports = {
text: textBody, text: textBody,
html: htmlBody, html: htmlBody,
} }
return Email.send(mailData) if (emailSending === 'true') return Email.send(mailData)
return {}
}, },
sendNotificationEmail: async ({ toEmail, user, emailType, meta = {} }) => { sendNotificationEmail: async ({ toEmail, user, emailType, meta = {} }) => {
let subject, textBody let subject, textBody
...@@ -375,6 +378,7 @@ module.exports = { ...@@ -375,6 +378,7 @@ module.exports = {
text: textBody, text: textBody,
html: htmlBody, html: htmlBody,
} }
return Email.send(mailData) if (emailSending === 'true') return Email.send(mailData)
return {}
}, },
} }
...@@ -123,4 +123,5 @@ module.exports = { ...@@ -123,4 +123,5 @@ module.exports = {
private: 'Pending Approval', private: 'Pending Approval',
}, },
}, },
'email-sending': process.env.EMAIL_SENDING || false,
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment