diff --git a/packages/component-invite/src/helpers/Invitation.js b/packages/component-invite/src/helpers/Invitation.js index e871e3560744f536eb605ea79aa759c15c25bf7a..855b265cffdb21fb872f75606fb8da739cd1898b 100644 --- a/packages/component-invite/src/helpers/Invitation.js +++ b/packages/component-invite/src/helpers/Invitation.js @@ -37,6 +37,7 @@ const setupReviewerInvitation = async ( user, mailService, invitationId, + invitationTimestamp, ) => { const baseUrl = `${req.protocol}://${req.get('host')}` const fragment = await models.Fragment.find(collection.fragments[0]) @@ -52,6 +53,14 @@ const setupReviewerInvitation = async ( let { abstract, title } = fragment.metadata title = title.replace(/<(.|\n)*?>/g, '') abstract = abstract ? abstract.replace(/<(.|\n)*?>/g, '') : '' + const date = new Date(invitationTimestamp) + let expectedDate = date.getDate() + 14 + date.setDate(expectedDate) + expectedDate = date.toLocaleDateString('en-US', { + day: 'numeric', + month: 'long', + year: 'numeric', + }) await mailService.setupReviewerInvitationEmail( user, baseUrl, @@ -62,6 +71,7 @@ const setupReviewerInvitation = async ( authors, fragment.id, invitationId, + expectedDate, ) } diff --git a/packages/component-invite/src/routes/collectionsInvitations/post.js b/packages/component-invite/src/routes/collectionsInvitations/post.js index 3ee387d35e3a522d06c6722591a31f2c77bf1df6..abffa83d3aba78469b4e31dc0b11f731daf67aaf 100644 --- a/packages/component-invite/src/routes/collectionsInvitations/post.js +++ b/packages/component-invite/src/routes/collectionsInvitations/post.js @@ -76,6 +76,7 @@ module.exports = models => async (req, res) => { user, mailService, invitation.id, + invitation.timestamp, ) } else { return res.status(500).json({ @@ -122,6 +123,7 @@ module.exports = models => async (req, res) => { newUser, mailService, invitation.id, + invitation.timestamp, ) return res.status(200).json(newUser) } diff --git a/packages/component-mail-service/src/Mail.js b/packages/component-mail-service/src/Mail.js index d0cd73a98305e197cb38d923b02b51979fddcd41..b29e60fc3ae8166583c685b1f2e5be6cff45eec8 100644 --- a/packages/component-mail-service/src/Mail.js +++ b/packages/component-mail-service/src/Mail.js @@ -147,6 +147,7 @@ module.exports = { authors, fragmentId, invitationId, + expectedDate, ) => { const subject = `${collection.customId}: Review Requested` let agreeUrl = `${baseUrl}/projects/${ @@ -155,7 +156,11 @@ module.exports = { invitationId, agree: true, })}` - const declineUrl = '' + const declineUrl = `${baseUrl}${resetPasswordPath}?${querystring.encode({ + collectionId: collection.id, + agree: false, + invitationId, + })}` if (!invitedUser.isConfirmed) { agreeUrl = `${baseUrl}${resetPasswordPath}?${querystring.encode({ email: invitedUser.email, @@ -180,6 +185,7 @@ module.exports = { submittingAuthor.lastName }`, authors, + expectedDate, } const { htmlBody, textBody } = getEmailBody('invite-reviewer', replacements) diff --git a/packages/component-mail-service/src/templates/invite-reviewer.html b/packages/component-mail-service/src/templates/invite-reviewer.html index b038768e09b71476e020f567491700df7a1a893d..d286cb63c30c76bcaa86669c9cb19b99e48810b9 100644 --- a/packages/component-mail-service/src/templates/invite-reviewer.html +++ b/packages/component-mail-service/src/templates/invite-reviewer.html @@ -202,8 +202,7 @@ <tbody> <tr> <td align="center" class="outer-td" style="padding:0px 0px 0px 0px"> - <table border="0" cellPadding="0" cellSpacing="0" class="button-css__deep-table___2OZyb wrapper-mobile" - style="text-align:center"> + <table border="0" cellPadding="0" cellSpacing="0" class="button-css__deep-table___2OZyb wrapper-mobile" style="text-align:center"> <tbody> <tr> <td align="center" bgcolor="#0d78f2" class="inner-td" style="border-radius:6px;font-size:16px;text-align:center;background-color:inherit"> @@ -238,8 +237,7 @@ <tbody> <tr> <td align="center" class="outer-td" style="padding:0px 0px 0px 0px"> - <table border="0" cellPadding="0" cellSpacing="0" class="button-css__deep-table___2OZyb wrapper-mobile" - style="text-align:center"> + <table border="0" cellPadding="0" cellSpacing="0" class="button-css__deep-table___2OZyb wrapper-mobile" style="text-align:center"> <tbody> <tr> <td align="center" bgcolor="#e4dfdf" class="inner-td" style="border-radius:6px;font-size:16px;text-align:center;background-color:inherit"> @@ -309,7 +307,9 @@ </p> <p> </p> - + <p>If you are able to review the manuscript, I would be grateful if you could submit your + report by {{ expectedDate }}.</p> + <p> </p> <p>With many thanks and best regards, <br /> {{editorName}} <br /> {{editorEmail}} @@ -323,7 +323,7 @@ <div data-role="module-unsubscribe" class="module unsubscribe-css__unsubscribe___2CDlR" role="module" data-type="unsubscribe" style="color:#444444;font-size:12px;line-height:20px;padding:16px 16px 16px 16px;text-align:center"> <div class="Unsubscribe--addressLine"> - <p class="Unsubscribe--senderName" style="font-family:Arial,Helvetica, sans-serif;font-size:12px;line-height:20px">[Sender_Name]</p> + <p class="Unsubscribe--senderName" style="font-family:Arial,Helvetica, sans-serif;font-size:12px;line-height:20px">Hindawi Publishing Corporation</p> <p style="font-family:Arial,Helvetica, sans-serif;font-size:12px;line-height:20px"> <span class="Unsubscribe--senderAddress">315 Madison Ave, Third Floor, Suite 3070</span>, <span class="Unsubscribe--senderCity">NEW YORK</span>, diff --git a/packages/component-mail-service/src/templates/invite-reviewer.txt b/packages/component-mail-service/src/templates/invite-reviewer.txt index 506e313f96abe4fb0fe9b9cf0f11c10e4b4eaace..b12453439865317778e15051cb62f2ef052d8ea0 100644 --- a/packages/component-mail-service/src/templates/invite-reviewer.txt +++ b/packages/component-mail-service/src/templates/invite-reviewer.txt @@ -26,6 +26,8 @@ opportunity. For more information about our conflicts of interest policies, plea see: https://www.hindawi.com/ethics/#coi +If you are able to review the manuscript, I would be grateful if you could submit your report by {{ expectedDate }}. + With many thanks and best regards, {{editorName}} {{editorEmail}} \ No newline at end of file