Newer
Older
Sebastian Mihalache
committed
const config = require('config')
const { upperFirst } = require('lodash')
Sebastian Mihalache
committed
const staffEmail = config.get('journal.staffEmail')
const journalName = config.get('journal.name')
Sebastian Mihalache
committed
const getEmailCopy = ({
Sebastian Mihalache
committed
emailType,
titleText,
comments = '',
targetUserName = '',
expectedDate = new Date(),
Sebastian Mihalache
committed
}) => {
let paragraph
let hasLink = true
Sebastian Mihalache
committed
let hasIntro = true
let hasSignature = true
Sebastian Mihalache
committed
switch (emailType) {
case 'author-request-to-revision':
Sebastian Mihalache
committed
paragraph = `After reviewing ${titleText}, I have requested further revisions to the manuscript. <br/><br/>
${comments}<br/><br/>
Sebastian Mihalache
committed
For more information about the requested changes and to submit your revised manuscript, please visit the manuscript details page.`
Sebastian Mihalache
committed
break
case 'author-manuscript-rejected':
Sebastian Mihalache
committed
paragraph = `The peer review of ${titleText} has now been completed. I regret to inform you that your manuscript has been rejected for publication.<br/><br/>
${comments}<br/><br/>
Thank you for your submission to ${journalName}.`
Sebastian Mihalache
committed
hasLink = false
break
case 'author-manuscript-published':
Sebastian Mihalache
committed
paragraph = `I am delighted to inform you that the review of ${titleText} has been completed and your article will be published in ${journalName}.<br/><br/>
Please visit the manuscript details page to review the editorial notes and any comments from external reviewers.<br/><br/>
Your article will now be passed to our production team for processing, and you will hear directly from them should we require any further information.<br/><br/>
Thank you for choosing to publish with ${journalName}.`
Sebastian Mihalache
committed
break
case 'he-manuscript-rejected':
hasLink = false
Sebastian Mihalache
committed
hasIntro = false
hasSignature = false
paragraph = `${targetUserName} has confirmed your decision to reject the ${titleText}.<br/><br/>
No further action is required at this time. To review this decision, please visit the manuscript details page.<br/><br/>
Thank you for handling this manuscript on behalf of ${journalName}.`
Sebastian Mihalache
committed
break
case 'he-manuscript-published':
hasIntro = false
hasSignature = false
Sebastian Mihalache
committed
paragraph = `${targetUserName} has confirmed your decision to accept ${titleText}.<br/><br/>
No further action is required at this time. To review this decision, please visit the manuscript details.<br/><br/>
Thank you for handling this manuscript on behalf of ${journalName}.`
Sebastian Mihalache
committed
break
case 'he-manuscript-return-with-comments':
Sebastian Mihalache
committed
paragraph = `${targetUserName} has responded with comments regarding your editorial recommendation on ${titleText}.<br/><br/>
${comments}<br/><br/>
Please review these comments and take action on the manuscript details page.`
Sebastian Mihalache
committed
break
case 'accepted-reviewers-after-recommendation':
hasLink = false
Sebastian Mihalache
committed
paragraph = `I appreciate any time you may have spent reviewing ${titleText}. However, I am prepared to make an editorial decision and your review is no longer required at this time. I apologize for any inconvenience. <br/><br/>
If you have comments on this manuscript you believe I should see, please email them to ${staffEmail} as soon as possible. <br/><br/>
Thank you for your interest and I hope you will consider reviewing for ${journalName} again.`
Sebastian Mihalache
committed
break
case 'pending-reviewers-after-recommendation':
Sebastian Mihalache
committed
hasLink = false
Sebastian Mihalache
committed
paragraph = `I appreciate any time you may have spent reviewing ${titleText} for ${journalName}. However, I am prepared to make an editorial decision and your review is no longer required at this time. I apologize for any inconvenience. <br/><br/>
If you have comments on this manuscript you believe I should see, please email them to ${staffEmail} as soon as possible. <br/><br/>
Thank you for your interest and I hope you will consider reviewing for ${journalName} again.`
Sebastian Mihalache
committed
break
case 'submitted-reviewers-after-publish':
Sebastian Mihalache
committed
paragraph = `Thank you for your review of ${titleText} for ${journalName}. After taking into account the reviews and the recommendation of the Handling Editor, I can confirm this article will now be published.<br/><br/>
No further action is required at this time. To see more details about this decision please view the manuscript details page.<br/><br/>
If you have any questions about this decision, then please email them to ${staffEmail} as soon as possible. Thank you reviewing for ${journalName}.`
Sebastian Mihalache
committed
break
case 'submitted-reviewers-after-reject':
Sebastian Mihalache
committed
paragraph = `Thank you for your review of ${titleText} for ${journalName}. After taking into account the reviews and the recommendation of the Handling Editor, I can confirm this article has now been rejected.<br/><br/>
No further action is required at this time. To see more details about this decision please view the manuscript details page.<br/><br/>
If you have any questions about this decision, please email them to ${staffEmail} as soon as possible. Thank you for reviewing for ${journalName}.`
Sebastian Mihalache
committed
break
paragraph = `We are pleased to inform you that Dr. ${targetUserName} has submitted a review for ${titleText}.<br/><br/>
Sebastian Mihalache
committed
To see the full report, please visit the manuscript details page.`
break
case 'eic-recommend-to-publish-from-he':
Sebastian Mihalache
committed
hasIntro = false
hasSignature = false
paragraph = `Dr. ${targetUserName} has recommended accepting ${titleText} for publication.<br/>
${comments}<br/>
Sebastian Mihalache
committed
To review this decision, please visit the manuscript details page.`
break
case 'eic-recommend-to-reject-from-he':
Sebastian Mihalache
committed
hasIntro = false
hasSignature = false
paragraph = `Dr. ${targetUserName} has recommended rejecting ${titleText}.<br/><br/>
${comments}<br/><br/>
Sebastian Mihalache
committed
To review this decision, please visit the manuscript details page.`
break
case 'eic-request-revision-from-he':
Sebastian Mihalache
committed
hasIntro = false
hasSignature = false
paragraph = `Dr. ${targetUserName} has asked the authors to submit a revised version of ${titleText}.<br/><br/>
No action is required at this time. To see the requested changes, please visit the manuscript details page.`
Sebastian Mihalache
committed
break
case 'eqa-manuscript-request-for-approval':
Sebastian Mihalache
committed
hasIntro = false
hasSignature = false
paragraph = `Manuscript ID ${customId} has passed peer-review and is now ready for EQA. Please click on the link below to either approve or return the manuscript to the Editor in Chief:`
break
case 'eqa-manuscript-published':
hasLink = false
Sebastian Mihalache
committed
hasIntro = false
hasSignature = false
paragraph = `${upperFirst(titleText)} has been accepted
for publication by ${eicName}.<br/><br/>
Please complete QA screening so that manuscript can be sent to production.`
case 'authors-manuscript-rejected-before-review':
paragraph = `I regret to inform you that your manuscript has been rejected for publication in ${journalName} for the following reason:<br/><br/>
${comments}<br/><br/>
Thank you for your submission, and please do consider submitting again in the future.`
hasLink = false
break
case 'eic-manuscript-accepted-by-eqs':
hasIntro = false
hasSignature = false
paragraph = `A new ${titleText} has been submitted to ${journalName}.<br/><br/>
To begin the review process, please visit the manuscript details page.`
break
case 'eic-manuscript-returned-by-eqa':
hasIntro = false
hasSignature = false
paragraph = `We regret to inform you that ${titleText} has been returned with comments. Please click the link below to access the manuscript.<br/><br/>
Comments: ${comments}<br/><br/>`
break
case 'submitted-reviewers-after-revision':
paragraph = `The authors have submitted a new version of ${titleText}, which you reviewed for ${journalName}.<br/><br/>
As you reviewed the previous version of this manuscript, I would be grateful if you could review this revision and submit a new report by ${expectedDate}.
To download the updated PDF and proceed with the review process, please visit the manuscript details page.<br/><br/>
Thank you again for reviewing for ${journalName}.`
break
case 'he-new-version-submitted':
hasIntro = false
hasSignature = false
paragraph = `The authors of ${titleText} have submitted a revised version. <br/><br/>
To review this new submission and proceed with the review process, please visit the manuscript details page.`
break
case 'eic-revision-published':
hasIntro = false
hasSignature = false
paragraph = `The authors of ${titleText} have submitted a revised version. <br/><br/>
To review this new submission and proceed with the review process, please visit the manuscript details page.`
break

Mihail Hagiu
committed
case 'author-request-to-revision-from-eic':
paragraph = `In order for ${titleText} to proceed to the review process, there needs to be a revision. <br/><br/>

Mihail Hagiu
committed
${comments}<br/><br/>
For more information about what is required, please click the link below.<br/><br/>`
break
Sebastian Mihalache
committed
default:
throw new Error(`The ${emailType} email type is not defined.`)
}
Sebastian Mihalache
committed
return { paragraph, hasLink, hasIntro, hasSignature }
Sebastian Mihalache
committed
}
module.exports = {
getEmailCopy,
}