Skip to content
Snippets Groups Projects
Commit b88d61ed authored by Mihail Hagiu's avatar Mihail Hagiu
Browse files

Merge branch 'HIN-1125-author-email-to-eic' into 'HIN-230-eic-request-revision'

Hin 1125 author email to eic

See merge request !181
parents 635e85aa 708771c0
No related branches found
No related tags found
4 merge requests!196S25 - EiC submit revision,!189S25,!181Hin 1125 author email to eic,!177Hin 230 eic request revision
...@@ -144,6 +144,12 @@ const getEmailCopy = ({ ...@@ -144,6 +144,12 @@ const getEmailCopy = ({
paragraph = `The authors of ${titleText} have submitted a revised version. <br/><br/> 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.` To review this new submission and proceed with the review process, please visit the manuscript details page.`
break 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': 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/> paragraph = `In order for ${titleText} to proceed to the review process, there needs to be a revision. <br/><br/>
${comments}<br/><br/> ${comments}<br/><br/>
......
...@@ -676,6 +676,48 @@ class Notification { ...@@ -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) { async notifyReviewersWhenAuthorSubmitsMajorRevision(newFragmentId) {
const { fragmentHelper } = await this._getNotificationProperties() const { fragmentHelper } = await this._getNotificationProperties()
const { collection, UserModel } = this const { collection, UserModel } = this
......
module.exports = { module.exports = {
execute: async ({ execute: async ({
models, models,
userHelper,
TeamHelper, TeamHelper,
fragmentHelper, fragmentHelper,
collectionHelper, collectionHelper,
notification,
userHelper,
}) => { }) => {
const eicRequestToRevision = fragmentHelper.getLatestEiCRequestToRevision() const eicRequestToRevision = fragmentHelper.getLatestEiCRequestToRevision()
if (!eicRequestToRevision) { if (!eicRequestToRevision) {
...@@ -40,6 +41,8 @@ module.exports = { ...@@ -40,6 +41,8 @@ module.exports = {
await collectionHelper.addFragment(newFragment.id) await collectionHelper.addFragment(newFragment.id)
await notification.notifyEditorInChiefWhenAuthorSubmitsRevision(newFragment)
return 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