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

fix(emails): fix email content

parent 4f92e560
No related branches found
No related tags found
1 merge request!43Sprint #19
Showing with 32 additions and 23 deletions
......@@ -15,12 +15,17 @@ const getEmailCopy = ({ emailType, titleText, targetUserName, comments }) => {
To review this manuscript and respond to the invitation, please visit the manuscript details page.`
break
case 'he-accepted':
paragraph = `Dr. ${targetUserName} agreed to be a Handling Editor on ${titleText}. Please click on the link below to access the manuscript.`
hasIntro = false
hasSignature = false
paragraph = `Dr. ${targetUserName} agreed to serve as the Handling Editor on ${titleText}.
Please click on the link below to access the manuscript.`
break
case 'he-declined':
paragraph = `Dr. ${targetUserName} has declined to be a Handling Editor on ${titleText}.<br/><br/>
${comments}`
hasLink = false
paragraph = `Dr. ${targetUserName} has declined to serve as the Handling Editor on ${titleText}.<br/><br/>
${comments}<br/><br/>
To invite another Handling Editor, please click the link below.`
hasIntro = false
hasSignature = false
break
case 'he-revoked':
hasIntro = false
......
......@@ -47,18 +47,20 @@ module.exports = {
eic,
email,
baseUrl,
customId,
comments,
titleText,
isAccepted,
targetUserName,
subjectBaseText,
}) => {
email.content.subject = `${subjectBaseText} Assignment Response`
email.content.subject = isAccepted
? `${customId}: Editor invitation accepted`
: `${customId}: Editor invitation declined`
const emailType = isAccepted ? 'he-accepted' : 'he-declined'
email.toUser = {
email: eic.email,
name: `${eic.firstName} ${eic.lastName}`,
}
email.content.unsubscribeLink = services.createUrl(
......
......@@ -37,7 +37,6 @@ module.exports = {
const eic = eics[0]
const eicName = `${eic.firstName} ${eic.lastName}`
const { customId } = collection
const subjectBaseText = `${customId}: Manuscript`
const email = new Email({
type: 'user',
......@@ -66,11 +65,11 @@ module.exports = {
eic,
email,
baseUrl,
comments: reason ? `Reason: "${reason}"` : '',
customId,
titleText,
isAccepted,
subjectBaseText,
targetUserName: `${invitedHE.firstName} ${invitedHE.lastName}`,
comments: reason ? `Reason: "${reason}"` : '',
targetUserName: `${invitedHE.lastName}`,
})
}
},
......
......@@ -13,9 +13,10 @@ const getEmailCopy = ({
let resend = false
switch (emailType) {
case 'reviewer-invitation':
upperContent = `${titleText}, has been submitted to ${journalName} for consideration. As the Academic Editor handling the manuscript, I would be delighted if you would agree to review it and let me know whether you feel it is suitable for publication.`
upperContent = `${titleText}, has been submitted to ${journalName} for consideration.
As the Academic Editor handling the manuscript, I would be delighted if you would agree to review it and let me know whether you feel it is suitable for publication.`
manuscriptText = `If you are able to review the manuscript, I would be grateful if you could submit your
report by ${expectedDate}.<br/>
report by ${expectedDate}.
The manuscript's abstract and author information is below to help you decide. Once you have agreed to review, you will be able to download the full article PDF.`
lowerContent = `If a potential conflict of interest exists between yourself and either the authors or
the subject of the manuscript, please decline to handle the manuscript. If a conflict
......
......@@ -74,7 +74,7 @@ const getEmailCopy = ({
If you have any questions about this decision, please email them to ${staffEmail} as soon as possible. Thank you for reviewing for ${journalName}.`
break
case 'he-review-submitted':
paragraph = `We are pleased to inform you that Dr. ${targetUserName} has submitted a review for ${titleText}.<br/>
paragraph = `We are pleased to inform you that Dr. ${targetUserName} has submitted a review for ${titleText}.<br/><br/>
To see the full report, please visit the manuscript details page.`
break
case 'eic-recommend-to-publish-from-he':
......
......@@ -32,7 +32,7 @@ module.exports = {
const fragmentAuthors = await fragmentHelper.getAuthorData({ UserModel })
const subjectBaseText = `${collection.customId}: Manuscript`
const titleText = `Txhe manuscript titled "${parsedFragment.title}" by ${
const titleText = `The manuscript titled "${parsedFragment.title}" by ${
fragmentAuthors.submittingAuthor.firstName
} ${fragmentAuthors.submittingAuthor.lastName}`
......
......@@ -2,15 +2,15 @@ const getEmailCopy = ({ emailType, titleText }) => {
let paragraph
switch (emailType) {
case 'submitting-author-added-by-admin':
paragraph = `${titleText}<br/>
Please verify your details by clicking the link below.<br/>
To confirm the submission and view the status of the manuscript, please verify your details by clicking the link below. <br/>`
paragraph = `${titleText}<br/><br/>
Please verify your details by clicking the link below.<br/><br/>
To confirm the submission and view the status of the manuscript, please verify your details by clicking the link below. <br/><br/>`
break
default:
throw new Error(`The ${emailType} email type is not defined.`)
}
return { paragraph, hasLink: true }
return { paragraph, hasLink: true, hasIntro: true, hasSignature: true }
}
module.exports = {
......
......@@ -2,6 +2,7 @@ const config = require('config')
const resetPath = config.get('invite-reset-password.url')
const unsubscribeSlug = config.get('unsubscribe.url')
const { name: journalName, staffEmail } = config.get('journal')
const {
User,
......@@ -28,18 +29,19 @@ module.exports = {
const userHelper = new User({ UserModel })
const eicName = await userHelper.getEiCName()
const titleText = `The manuscript titled "${title}" has been submitted to Hindawi by ${eicName}.`
const titleText = `The manuscript titled "${title}" has been submitted to ${journalName} by ${eicName}.`
const email = new Email({
type: 'user',
fromEmail: `${journalName} <${staffEmail}>`,
toUser: {
email: submittingAuthor.email,
name: `${submittingAuthor.firstName} ${submittingAuthor.lastName}`,
name: `${submittingAuthor.lastName}`,
},
content: {
ctaText: 'LOGIN',
signatureName: eicName,
subject: `Manuscript Submitted`,
signatureJournal: journalName,
subject: `Manuscript submitted`,
ctaLink: services.createUrl(baseUrl, ''),
unsubscribeLink: services.createUrl(baseUrl, unsubscribeSlug, {
id: submittingAuthor.id,
......
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