Skip to content
Snippets Groups Projects
Commit b013a78d 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 0c5fcaee b88d61ed
No related branches found
No related tags found
3 merge requests!196S25 - EiC submit revision,!189S25,!177Hin 230 eic request revision
......@@ -144,6 +144,12 @@ 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 'eic-revision-published':
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
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/>
......
......@@ -676,6 +676,48 @@ class Notification {
})
}
async notifyEditorInChiefWhenAuthorSubmitsRevision(newFragment) {
const { titleText } = await this._getNotificationProperties()
const userHelper = new User({ UserModel: this.UserModel })
const editors = await userHelper.getEditorsInChief()
const { paragraph, ...bodyProps } = getEmailCopy({
titleText,
emailType: 'eic-revision-published',
})
editors.forEach(eic => {
const email = new Email({
type: 'user',
fromEmail: `${journalName} <${staffEmail}>`,
toUser: {
email: eic.email,
},
content: {
subject: `${this.collection.customId}: Revision submitted`,
paragraph,
signatureName: '',
signatureJournal: journalName,
ctaLink: services.createUrl(
this.baseUrl,
`/projects/${this.collection.id}/versions/${
newFragment.id
}/details`,
),
ctaText: 'MANUSCRIPT DETAILS',
unsubscribeLink: services.createUrl(this.baseUrl, unsubscribeSlug, {
id: eic.id,
token: eic.accessTokens.unsubscribe,
}),
},
bodyProps,
})
return email.sendEmail()
})
}
async notifyReviewersWhenAuthorSubmitsMajorRevision(newFragmentId) {
const { fragmentHelper } = await this._getNotificationProperties()
const { collection, UserModel } = this
......
module.exports = {
execute: async ({
models,
userHelper,
TeamHelper,
fragmentHelper,
collectionHelper,
notification,
userHelper,
}) => {
const eicRequestToRevision = fragmentHelper.getLatestEiCRequestToRevision()
if (!eicRequestToRevision) {
......@@ -40,6 +41,8 @@ module.exports = {
await collectionHelper.addFragment(newFragment.id)
await notification.notifyEditorInChiefWhenAuthorSubmitsRevision(newFragment)
return newFragment
},
}
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