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

feat(emails): add from email

parent 0862add5
No related branches found
No related tags found
2 merge requests!43Sprint #19,!39update emails content and format
......@@ -5,7 +5,7 @@ const resetPath = config.get('invite-reset-password.url')
const { Email, services } = require('pubsweet-component-helper-service')
const { helpers } = require('./helpers')
const { sendNewUserEmail, sendSignupEmail } = require('./helpers')
module.exports = {
async sendNotifications({ user, baseUrl, role, UserModel }) {
......@@ -33,9 +33,9 @@ module.exports = {
})
if (role) {
helpers.sendNewUserEmail({ email, role })
sendNewUserEmail({ email, role })
} else {
helpers.sendSignupEmail({ email, baseUrl, user })
sendSignupEmail({ email, baseUrl, user })
}
},
}
......@@ -4,7 +4,7 @@ const helpers = require('./helpers')
const SendEmail = require('@pubsweet/component-send-email')
const logger = require('@pubsweet/logger')
const mainFromEmail = config.get('mailer.from')
const mainFromEmail = config.get('journal.staffEmail')
class Email {
constructor({
type = 'system',
......
......@@ -2,6 +2,8 @@ const config = require('config')
const { get } = require('lodash')
const unsubscribeSlug = config.get('unsubscribe.url')
const fromEmail = config.get('journal.staffEmail')
const journalName = config.get('journal.name')
const {
User,
......@@ -39,14 +41,16 @@ module.exports = {
const eicName = await userHelper.getEiCName()
const email = new Email({
fromEmail,
type: 'user',
content: {
ctaText: 'MANUSCRIPT DETAILS',
signatureJournal: journalName,
signatureName: handlingEditor.name,
ctaLink: services.createUrl(
baseUrl,
`/projects/${collection.id}/versions/${fragment.id}/details`,
),
ctaText: 'MANUSCRIPT DETAILS',
},
})
......@@ -98,6 +102,7 @@ const sendHandlingEditorEmail = ({
id: handlingEditor.id,
})
email.content.signatureName = eicName
email.content.signatureJournal = ''
const { html, text } = email.getBody({
body: getEmailCopy({
......
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