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

fix(reviewer-invitations): modify email content

parent aa5b4d25
No related branches found
No related tags found
1 merge request!21Sprint #16 features
// const querystring = require('querystring')
const fs = require('fs')
const handlebars = require('handlebars')
......
......@@ -7,7 +7,9 @@
<p data-pm-slice="1 1 []">&nbsp;</p>
{{> invManuscriptData }}
{{#unless resend }}
{{> invManuscriptData }}
{{/unless}}
<p data-pm-slice="1 1 []">{{{ lowerContent }}}</p>
<p>&nbsp;</p>
......
......@@ -5,7 +5,7 @@
<p data-pm-slice="1 1 []">Dear Dr. {{ toUserName }},</p>
<p>&nbsp;</p>
<p>{{ upperContent }}</p>
<p>{{{ upperContent }}}</p>
</div>
</td>
......
......@@ -8,6 +8,7 @@ const getEmailCopy = ({
}) => {
let upperContent, manuscriptText, lowerContent, paragraph
let hasLink = true
let resend = false
switch (emailType) {
case 'reviewer-invitation':
upperContent = `${titleText}, has been submitted for possible publication in Hindawi. 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.`
......@@ -18,35 +19,37 @@ const getEmailCopy = ({
becomes apparent during the review process, please let me know at the earliest possible
opportunity. For more information about our conflicts of interest policies, please
see:
<a href="https://www.hindawi.com/ethics/#coi">https://www.hindawi.com/ethics/#coi</a>.
<a href="https://www.hindawi.com/ethics/#coi">https://www.hindawi.com/ethics/#coi</a>.<br/><br/>
If you are able to review the manuscript, I would be grateful if you could submit your
report by ${expectedDate}.`
break
case 'reviewer-resend-invitation':
upperContent = `On ${expectedDate} I sent you a request to review ${titleText}, submitted for possible publication in Hindawi.
resend = true
upperContent = `On ${expectedDate} I sent you a request to review ${titleText}, submitted for possible publication in Hindawi.<br/><br/>
I would be grateful if you would agree to review it and let me know whether you feel
it is suitable for publication. If you are unable to review this manuscript then
please decline to review. More details are available by clicking the link.`
manuscriptText =
"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 =
'I would like to thank you in advance for your help with the evaluation of this manuscript, since it would not be possible for us to run the journal without the help of our reviewers. I am looking forward to hearing from you.'
lowerContent = `I would like to thank you in advance for your help with the evaluation of this manuscript, since it would not be possible for us to run the journal without the help of our reviewers.<br/><br/>
I am looking forward to hearing from you.`
break
case 'reviewer-accepted':
paragraph = `We are pleased to inform you that Dr. ${targetUserName} has agreed to review ${titleText}. You should receive the report by Dr. ${targetUserName} before ${expectedDate}. If you have any queries, or would like to send a reminder if you no report has been submitted, then please visit the manuscript details page to see the full review.`
paragraph = `We are pleased to inform you that Dr. ${targetUserName} has agreed to review ${titleText}.<br/><br/>
You should receive the report by Dr. ${targetUserName} before ${expectedDate}. If you have any queries, or would like to send a reminder if no report has been submitted, then please visit the manuscript details page.`
break
case 'reviewer-declined':
paragraph = `We regret to inform you that Dr. ${targetUserName} has declined to review ${titleText}. Please visit the manuscript details page to see if you need to invite any additional reviewers in order to reach a decision on the manuscript`
paragraph = `We regret to inform you that Dr. ${targetUserName} has declined to review ${titleText}.<br/><br/>
Please visit the manuscript details page to see if you need to invite any additional reviewers in order to reach a decision on the manuscript`
break
case 'reviewer-thank-you':
paragraph = `Thank you for agreeing to review ${titleText}. You can view the full PDF file of the manuscript and post your review report using the following URL:`
paragraph = `Thank you for agreeing to review ${titleText}.<br/><br/>
You can view the full PDF file of the manuscript and post your review report using the following URL:`
break
case 'reviewer-cancel-invitation':
paragraph = `You are no longer needed to review ${titleText}. If you have comments on this manuscript you believe the Editor should
see, please email them to ${config.get(
'mailer.from',
)} as soon as possible. Thank you for your
time and I hope you will consider reviewing for Hindawi again.`
paragraph = `You are no longer needed to review ${titleText}.<br/><br/>
If you have comments on this manuscript you believe the Editor should see, please email them to ${config.get(
'mailer.from',
)} as soon as possible.<br/><br/>
Thank you for your time and I hope you will consider reviewing for Hindawi again.`
hasLink = false
break
case 'reviewer-new-account':
......@@ -56,7 +59,14 @@ const getEmailCopy = ({
throw new Error(`The ${emailType} email type is not defined.`)
}
return { upperContent, manuscriptText, lowerContent, paragraph, hasLink }
return {
resend,
hasLink,
paragraph,
upperContent,
lowerContent,
manuscriptText,
}
}
module.exports = {
......
......@@ -70,6 +70,10 @@ module.exports = {
agreeLink = services.createUrl(baseUrl, inviteReviewerPath, queryParams)
}
const authorsList = authors.map(
author => `${author.firstName} ${author.lastName}`,
)
const email = new Email({
type: 'user',
toUser: {
......@@ -87,9 +91,7 @@ module.exports = {
unsubscribeLink: services.createUrl(baseUrl, unsubscribeSlug, {
id: invitedUser.id,
}),
authorsList: authors.map(
author => `${author.firstName} ${author.lastName}`,
),
authorsList,
},
})
......
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