Skip to content
Snippets Groups Projects
Commit 635e85aa authored by Sebastian Mihalache's avatar Sebastian Mihalache :hammer_pick:
Browse files

Merge branch 'HIN-230-eic-request-revision' of...

Merge branch 'HIN-230-eic-request-revision' of gitlab.coko.foundation:xpub/xpub-faraday into HIN-230-eic-request-revision
parents 7c745af8 a67bda78
No related branches found
No related tags found
3 merge requests!196S25 - EiC submit revision,!189S25,!177Hin 230 eic request revision
......@@ -144,6 +144,11 @@ const getEmailCopy = ({
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 '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/>
${comments}<br/><br/>
For more information about what is required, please click the link below.<br/><br/>`
break
default:
throw new Error(`The ${emailType} email type is not defined.`)
}
......
......@@ -407,6 +407,53 @@ class Notification {
return email.sendEmail()
}
async notifySAWhenEiCRequestsRevision() {
const {
eicName,
submittingAuthor,
titleText,
} = await this._getNotificationProperties()
const authorNoteText = helpers.getPrivateNoteTextForAuthor({
newRecommendation: this.newRecommendation,
})
const { paragraph, ...bodyProps } = getEmailCopy({
emailType: 'author-request-to-revision-from-eic',
titleText,
comments: authorNoteText,
})
const email = new Email({
type: 'user',
toUser: {
email: submittingAuthor.email,
name: submittingAuthor.lastName,
},
fromEmail: `${eicName} <${staffEmail}>`,
content: {
subject: `${this.collection.customId}: Revision requested`,
paragraph,
signatureName: eicName,
ctaText: 'MANUSCRIPT DETAILS',
signatureJournal: journalName,
unsubscribeLink: services.createUrl(this.baseUrl, unsubscribeSlug, {
id: submittingAuthor.id,
token: submittingAuthor.accessTokens.unsubscribe,
}),
ctaLink: services.createUrl(
this.baseUrl,
`/projects/${this.collection.id}/versions/${
this.fragment.id
}/details`,
),
},
bodyProps,
})
return email.sendEmail()
}
async notifyReviewersWhenHEMakesRecommendation() {
const {
eicName,
......
module.exports = {
execute: async ({ fragmentHelper, collectionHelper, newRecommendation }) => {
execute: async ({
fragmentHelper,
collectionHelper,
newRecommendation,
notification,
}) => {
if (collectionHelper.hasHandlingEditor()) {
throw new Error(
'Cannot make request a revision after a Handling Editor has been assigned.',
......@@ -9,5 +14,6 @@ module.exports = {
await fragmentHelper.addRevision()
await collectionHelper.updateStatus({ newStatus: 'revisionRequested' })
await fragmentHelper.addRecommendation(newRecommendation)
await notification.notifySAWhenEiCRequestsRevision()
},
}
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