From f485f2470c99722e895714fe2f8057604b6e8918 Mon Sep 17 00:00:00 2001
From: Mihail Hagiu <mihail.hagiu@thinslices.com>
Date: Tue, 8 Jan 2019 14:09:59 +0200
Subject: [PATCH] feat(ReviewerReminder): Readded old email

---
 .../routes/fragmentsInvitations/emails/emailCopy.js    | 10 +++++++++-
 .../src/routes/fragmentsInvitations/jobs/reminders.js  |  8 ++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/packages/component-invite/src/routes/fragmentsInvitations/emails/emailCopy.js b/packages/component-invite/src/routes/fragmentsInvitations/emails/emailCopy.js
index 7b56c6cdb..7c24136bd 100644
--- a/packages/component-invite/src/routes/fragmentsInvitations/emails/emailCopy.js
+++ b/packages/component-invite/src/routes/fragmentsInvitations/emails/emailCopy.js
@@ -26,13 +26,21 @@ const getEmailCopy = ({
         <a style="color:#007e92; text-decoration: none;" href="https://www.hindawi.com/ethics/#coi">https://www.hindawi.com/ethics/#coi</a>.`
       break
     case 'reviewer-resend-invitation':
+      resend = true
+      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.`
+      break
+    case 'reviewer-resend-invitation-first-reminder':
       resend = true
       upperContent = `On ${expectedDate} I invited you to review ${titleText}, submitted for possible publication in ${journalName}.<br/><br/>
         We'd be grateful if you could submit a decision on whether or not you will be able to review this manuscript using the link below.`
       lowerContent = `Thank you in advance for your help with the evaluation of this manuscript.<br/><br/>
         We look forward to hearing from you.`
       break
-    case 'reviewer-resend-invitation-second':
+    case 'reviewer-resend-invitation-second-reminder':
       resend = true
       upperContent = `We sent you a request to review ${titleText}; however we have not yet received your decision. 
         We would appreciate it if you could visit the following link to let us know whether or not you will be able to review this manuscript:`
diff --git a/packages/component-invite/src/routes/fragmentsInvitations/jobs/reminders.js b/packages/component-invite/src/routes/fragmentsInvitations/jobs/reminders.js
index 3f495f389..bad96940e 100644
--- a/packages/component-invite/src/routes/fragmentsInvitations/jobs/reminders.js
+++ b/packages/component-invite/src/routes/fragmentsInvitations/jobs/reminders.js
@@ -21,8 +21,12 @@ const scheduleReminderJob = async ({
 
   const queue = `reminders-${userId}-${invitationId}`
 
-  let emailType = `reviewer-resend-invitation`
-  if (days === 7 || days === 13) emailType += '-second'
+  const terminations = {
+    4: 'first-reminder',
+    7: 'second-reminder',
+    13: 'second-reminder',
+  }
+  const emailType = `reviewer-resend-invitation-${terminations[days]}`
 
   const { paragraph, ...bodyProps } = getEmailCopy({
     emailType,
-- 
GitLab