Skip to content
Snippets Groups Projects
Commit 43ecc9ce authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Merge branch 'hin-858' of gitlab.coko.foundation:xpub/xpub-faraday into hin-858

parents 8bcf1763 bde101fc
No related branches found
No related tags found
1 merge request!108Hin 858 revision fix
......@@ -5,10 +5,12 @@ const journalName = config.get('journal.name')
const getEmailCopy = ({ emailType, titleText, expectedDate, customId }) => {
let paragraph
const hasLink = true
const hasIntro = true
const hasSignature = true
let hasIntro = true
let hasSignature = true
switch (emailType) {
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
......
......@@ -21,6 +21,7 @@ module.exports = {
UserModel,
collection,
isNewVersion = false,
previousVersion,
isTechnicalCheck,
isMajorRecommendation,
}) {
......@@ -59,7 +60,6 @@ module.exports = {
const heUser = await UserModel.find(handlingEditor.id)
sendHandlingEditorEmail({
email,
eicName,
baseUrl,
customId,
title: parsedFragment.title,
......@@ -73,8 +73,9 @@ module.exports = {
baseUrl,
customId,
UserModel,
fragmentHelper,
previousVersion,
title: parsedFragment.title,
heName: collection.handlingEditor.name,
})
}
......@@ -104,7 +105,6 @@ module.exports = {
const sendHandlingEditorEmail = ({
email,
title,
eicName,
baseUrl,
customId,
handlingEditor,
......@@ -113,19 +113,17 @@ const sendHandlingEditorEmail = ({
email.toUser = {
email: handlingEditor.email,
name: handlingEditor.name,
}
email.content.unsubscribeLink = services.createUrl(baseUrl, unsubscribeSlug, {
id: handlingEditor.id,
token: handlingEditor.accessTokens.unsubscribe,
})
email.content.signatureName = eicName
email.content.subject = `${customId}: Revision submitted`
const { html, text } = email.getNotificationBody({
emailBodyProps: getEmailCopy({
emailType,
titleText: `the manuscript titled ${title}`,
titleText: `the manuscript titled "${title}"`,
}),
})
email.sendEmail({ html, text })
......@@ -134,14 +132,18 @@ const sendHandlingEditorEmail = ({
const sendReviewersEmail = async ({
email,
title,
heName,
baseUrl,
customId,
UserModel,
fragmentHelper,
previousVersion,
}) => {
email.content.subject = `${customId}: A manuscript you reviewed has been revised`
email.content.signatureName = heName
email.fromEmail = `${heName} <${staffEmail}>`
const emailType = 'submitted-reviewers-after-revision'
const fragmentHelper = new Fragment({ fragment: previousVersion })
const reviewers = await fragmentHelper.getReviewers({
UserModel,
type: 'submitted',
......@@ -165,7 +167,7 @@ const sendReviewersEmail = async ({
const { html, text } = email.getNotificationBody({
emailBodyProps: getEmailCopy({
emailType,
titleText: `the manuscript titled ${title}`,
titleText: `the manuscript titled "${title}"`,
expectedDate: services.getExpectedDate({ daysExpected: 14 }),
}),
})
......
......@@ -116,10 +116,11 @@ module.exports = models => async (req, res) => {
collection.save()
notifications.sendNotifications({
fragment: newFragment,
collection,
isNewVersion: true,
fragment: newFragment,
UserModel: models.User,
previousVersion: fragment,
baseUrl: services.getBaseUrl(req),
isMajorRecommendation: heRecommendation.recommendation === 'major',
})
......
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