Skip to content
Snippets Groups Projects
emailCopy.js 3.84 KiB
Newer Older
const journalName = config.get('journal.name')

const getEmailCopy = ({
  emailType,
  titleText,
  expectedDate,
  targetUserName,
}) => {
  let upperContent, manuscriptText, lowerContent, paragraph
  let hasLink = true
  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.`
      manuscriptText = `If you are able to review the manuscript, I would be grateful if you could submit your
        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
        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>.<br/><br/>`
      upperContent = `On ${expectedDate} I invited you to review ${titleText}, submitted to ${journalName} for consideration.<br/><br/>
        I would be grateful if you would agree to review the manuscript and let me know whether you feel
        it is suitable for publication. If you are unable to review this manuscript please decline to review. More details are available by clicking the link below.`
      lowerContent = `Thank you in advance for taking the time to consider this invitation, as 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.`
      paragraph = `We are pleased to inform you that Dr. ${targetUserName} has agreed to review ${titleText}.<br/><br/>
        You should receive the report before ${expectedDate}.<br/><br/>
        If the review is delayed and you would like to send a reminder to Dr. ${targetUserName}, please visit the manuscript details page.`
      paragraph = `We regret to inform you that Dr. ${targetUserName} has declined to review ${titleText}.<br/><br/>
        Please visit the manuscript details to invite additional reviewers in order to reach a decision on the manuscript. `
      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 link.<br/>
        You will be asked to log in before being able to complete your review.`
      paragraph = `We recently invited you to review ${titleText} for ${journalName}.<br/>
        This is to confirm that we no longer require your review.<br/><br/>
        If you have comments on the manuscript you believe I should see, please email them to ${config.get(
          'journal.staffEmail',
        )} as soon as possible.<br/><br/>
        Thank you for your time and I hope you will consider reviewing for ${journalName} in the future.`
      hasLink = false
      break
    default:
      throw new Error(`The ${emailType} email type is not defined.`)
  }

  return {
    resend,
    hasLink,
    paragraph,
    upperContent,
    lowerContent,
    manuscriptText,