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

feat(fragmentsRecommendations): separate email sending flows

parent c2c18d86
No related branches found
No related tags found
1 merge request!115Hin 1038
Showing
with 571 additions and 158 deletions
......@@ -4,19 +4,13 @@ const { services } = require('pubsweet-component-helper-service')
const { getEmailCopy } = require('./emailCopy')
const confirmSignUp = config.get('confirm-signup.url')
const { name: journalName, staffEmail } = config.get('journal')
module.exports = {
sendNewUserEmail: ({ email, role }) => {
email.content.subject = 'Confirm your account'
let emailType
if (role === 'Handling Editor') {
emailType = 'he-added-by-admin'
email.fromEmail = `${journalName} <${staffEmail}>`
} else {
emailType = 'user-added-by-admin'
}
const emailType =
role === 'Handling Editor' ? 'he-added-by-admin' : 'user-added-by-admin'
const { html, text } = email.getNotificationBody({
emailBodyProps: getEmailCopy({
......
......@@ -2,7 +2,7 @@ const config = require('config')
const unsubscribeSlug = config.get('unsubscribe.url')
const resetPath = config.get('invite-reset-password.url')
const staffEmail = config.get('journal.staffEmail')
const { staffEmail, name: journalName } = config.get('journal')
const Email = require('@pubsweet/component-email-templating')
const { services } = require('pubsweet-component-helper-service')
......@@ -12,7 +12,7 @@ module.exports = {
async sendNotifications({ user, baseUrl, role }) {
const email = new Email({
type: 'user',
fromEmail: `Hindawi <${staffEmail}>`,
fromEmail: `${journalName} <${staffEmail}>`,
toUser: {
email: user.email,
name: `${user.lastName}`,
......
......@@ -4,7 +4,6 @@ const { services } = require('pubsweet-component-helper-service')
const { getEmailCopy } = require('./emailCopy')
const unsubscribeSlug = config.get('unsubscribe.url')
const { name: journalName, staffEmail } = config.get('journal')
module.exports = {
sendInvitedHEEmail: ({
......@@ -24,7 +23,6 @@ module.exports = {
? `${customId}: Editor invitation cancelled`
: `${customId}: Invitation to edit a manuscript`
email.fromEmail = `${journalName} <${staffEmail}>`
email.content.unsubscribeLink = services.createUrl(
baseUrl,
unsubscribeSlug,
......
const config = require('config')
const { last } = require('lodash')
const Email = require('@pubsweet/component-email-templating')
const { name: journalName, staffEmail } = config.get('journal')
const {
User,
services,
......@@ -40,6 +43,7 @@ module.exports = {
const email = new Email({
type: 'user',
fromEmail: `${journalName} <${staffEmail}>`,
content: {
signatureName: eicName,
ctaLink: services.createUrl(
......
......@@ -5,7 +5,7 @@ const { services } = require('pubsweet-component-helper-service')
const { getEmailCopy } = require('./emailCopy')
const unsubscribeSlug = config.get('unsubscribe.url')
const journalName = config.get('journal.name')
const { name: journalName, staffEmail } = config.get('journal')
module.exports = {
sendReviewersEmail: async ({ email, baseUrl, reviewers }) => {
......@@ -22,14 +22,14 @@ module.exports = {
token: reviewer.accessTokens.unsubscribe,
},
)
const { html, text } = email.getNotificationBody({
emailBodyProps: {
paragraph: reviewer.paragraph,
hasLink: reviewer.hasLink,
hasIntro: reviewer.hasIntro,
hasSignature: reviewer.hasSignature,
},
})
const emailBodyProps = {
paragraph: reviewer.paragraph,
hasLink: reviewer.hasLink,
hasIntro: reviewer.hasIntro,
hasSignature: reviewer.hasSignature,
}
const { html, text } = email.getNotificationBody({ emailBodyProps })
email.sendEmail({ html, text })
})
},
......@@ -99,6 +99,7 @@ module.exports = {
email.content.subject = `${customId}: ${subject}`
email.content.signatureName = signatureName
email.content.signatureJournal = journalName
email.fromEmail = `${signatureName} <$staffEmail>`
return email
},
sendHandlingEditorEmail: ({
......@@ -106,14 +107,14 @@ module.exports = {
comments,
emailType,
titleText,
targetUserName,
reviewerLastName,
}) => {
const { html, text } = email.getNotificationBody({
emailBodyProps: getEmailCopy({
emailType,
titleText,
comments,
targetUserName,
targetUserName: reviewerLastName,
}),
})
email.sendEmail({ html, text })
......@@ -128,6 +129,8 @@ module.exports = {
recommendation,
recommendationType,
}) => {
// TODO: this should probably be split in two functions, one for each type
email.fromEmail = `${eicName} <${staffEmail}>`
if (recommendationType === 'review') {
email.content.subject = `${customId}: A review has been submitted`
} else {
......@@ -205,7 +208,7 @@ module.exports = {
recommendation: { recommendation, comments: recComments = [] },
}) => {
let emailType
email.fromEmail = `${journalName} <${staffEmail}>`
switch (recommendation) {
case 'minor':
case 'major':
......@@ -307,6 +310,7 @@ module.exports = {
return authorNoteText
},
updateEmailContentForSA: ({ email, customId, signatureName }) => {
email.fromEmail = `${signatureName} <${staffEmail}>`
email.content.subject = `${customId}: Revision requested`
email.content.signatureName = signatureName
email.content.signatureJournal = journalName
......@@ -363,7 +367,13 @@ module.exports = {
})
email.sendEmail({ html, text })
},
updateEmailContentForAllAuthors: ({ email, recommendation, customId }) => {
updateEmailContentForAllAuthors: ({
email,
recommendation,
customId,
eicName,
}) => {
email.fromEmail = `${eicName} <${staffEmail}>`
switch (recommendation) {
case 'publish':
email.content.subject = `${customId}: Manuscript accepted`
......@@ -398,4 +408,58 @@ module.exports = {
return emailType
},
sendEQAEmail: ({
email,
eicName,
baseUrl,
titleText,
collection,
subjectBaseText,
}) => {
let emailType
switch (collection.status) {
case 'accepted':
emailType = 'eqa-manuscript-published'
email.content.subject = `${subjectBaseText} decision finalized`
break
case 'inQA':
emailType = 'eqa-manuscript-request-for-approval'
email.content.subject = `${subjectBaseText} Request for EQA Approval`
email.content.ctaLink = services.createUrl(
baseUrl,
config.get('eqa-decision.url'),
{
collectionId: collection.id,
customId: collection.customId,
token: collection.technicalChecks.token,
},
)
email.content.ctaText = 'MAKE DECISION'
break
default:
throw new Error(
`Cannot send EQA email when collection status is ${
collection.status
} `,
)
}
email.toUser = {
email: editorialAssistantEmail,
name: 'Editorial Assistant',
}
email.content.unsubscribeLink = baseUrl
email.content.signatureName = eicName
const { html, text } = email.getNotificationBody({
emailBodyProps: getEmailCopy({
eicName,
titleText,
emailType,
customId: collection.customId,
}),
})
email.sendEmail({ html, text })
},
}
const config = require('config')
const { get } = require('lodash')
const Email = require('@pubsweet/component-email-templating')
const unsubscribeSlug = config.get('unsubscribe.url')
const {
User,
services,
Fragment,
Collection,
} = require('pubsweet-component-helper-service')
// const { getEmailCopy } = require('./emailCopy')
const helpers = require('./helpers')
const reviewHelpers = require('./reviewerSubmitsReport/helpers')
// const editorialAssistantEmail = config.get('journal.staffEmail')
const { name: journalName, staffEmail } = config.get('journal')
class Notification {
constructor({
baseUrl = '',
fragment = {},
UserModel = {},
collection = {},
newRecommendation = {},
}) {
this.baseUrl = baseUrl
this.fragment = fragment
this.UserModel = UserModel
this.collection = collection
this.newRecommendation = newRecommendation
this.properties = this._getNotificationProperties()
}
async heMakesRecommendation() {
const notificationProperties = this.getNotificationProperties()
}
async eicMakesDecision() {
const notificationProperties = this.getNotificationProperties()
}
async notifyHEWhenReviewerSubmitsReport(reviewerLastName) {
const { eicName, titleText } = this.properties
const { collection } = this
const handlingEditor = get(collection, 'handlingEditor', {})
const { customId } = collection
const collHelper = new Collection({ collection })
const email = new Email({
type: 'user',
toUser: {
email: handlingEditor.email,
name: collHelper.getHELastName(),
},
fromEmail: `${eicName} <${staffEmail}>`,
content: {
signatureName: eicName,
ctaText: 'MANUSCRIPT DETAILS',
subject: `${customId}: A review has been submitted`,
unsubscribeLink: services.createUrl(this.baseUrl, unsubscribeSlug, {
id: handlingEditor.id,
token: handlingEditor.accessTokens.unsubscribe,
}),
ctaLink: services.createUrl(
this.baseUrl,
`/projects/${this.collection.id}/versions/${
this.fragment.id
}/details`,
),
},
})
helpers.sendHandlingEditorEmail({
email,
titleText,
reviewerLastName,
emailType: 'he-review-submitted',
})
}
async _getNotificationProperties() {
const fragmentHelper = new Fragment({ fragment: this.fragment })
const parsedFragment = await fragmentHelper.getFragmentData({
handlingEditor: this.collection.handlingEditor,
})
const { submittingAuthor } = await fragmentHelper.getAuthorData({
UserModel: this.UserModel,
})
const titleText = `the manuscript titled "${parsedFragment.title}" by ${
submittingAuthor.firstName
} ${submittingAuthor.lastName}`
const { recommendation, recommendationType } = this.newRecommendation
return { recommendation, recommendationType, titleText }
}
}
module.exports = Notification
......@@ -13,16 +13,222 @@ const { getEmailCopy } = require('./emailCopy')
const helpers = require('./helpers')
const editorialAssistantEmail = config.get('journal.staffEmail')
const journalName = config.get('journal.name')
const { name: journalName } = config.get('journal')
module.exports = {
async sendNotifications({
// async sendNotifications({
// hasEQA,
// baseUrl,
// fragment,
// UserModel,
// collection,
// targetUserName,
// isEditorInChief,
// newRecommendation,
// }) {
// const fragmentHelper = new Fragment({ fragment })
// const parsedFragment = await fragmentHelper.getFragmentData({
// handlingEditor: collection.handlingEditor,
// })
// const {
// activeAuthors,
// submittingAuthor,
// } = await fragmentHelper.getAuthorData({ UserModel })
// const subjectBaseText = `${collection.customId}: Manuscript`
// const titleText = `The manuscript titled "${parsedFragment.title}" by ${
// submittingAuthor.firstName
// } ${submittingAuthor.lastName}`
// const userHelper = new User({ UserModel })
// const eicName = await userHelper.getEiCName()
// let email = new Email({
// type: 'user',
// content: {
// signatureName: eicName,
// unsubscribeLink: baseUrl,
// ctaText: 'MANUSCRIPT DETAILS',
// signatureJournal: journalName,
// ctaLink: services.createUrl(
// baseUrl,
// `/projects/${collection.id}/versions/${fragment.id}/details`,
// ),
// },
// })
// const { recommendation, recommendationType } = newRecommendation
// // the EiC recommends to publish so an email to the EQA needs to be sent,
// // one requesting approval or one informing them that the manuscript has been published
// if (
// isEditorInChief &&
// recommendation === 'publish' &&
// collection.technicalChecks.token
// ) {
// sendEQAEmail({
// email,
// eicName,
// baseUrl,
// titleText,
// collection,
// subjectBaseText,
// })
// }
// const hasPeerReview = !isEmpty(collection.handlingEditor)
// const { customId } = collection
// const collHelper = new Collection({ collection })
// // send HE emails when a review is submitted
// // or when the EiC makes a recommendation after peer review
// if (
// recommendationType === 'review' ||
// (isEditorInChief &&
// hasPeerReview &&
// (recommendation !== 'publish' || hasEQA))
// ) {
// const handlingEditor = get(collection, 'handlingEditor', {})
// const heUser = await UserModel.find(handlingEditor.id)
// email = helpers.updateEmailContentForHE({
// email,
// baseUrl,
// eicName,
// customId,
// recommendation,
// recommendationType,
// heLastName: collHelper.getHELastName(),
// handlingEditor: heUser,
// })
// const emailType = helpers.getEmailTypeByRecommendationForHE({
// recommendation,
// recommendationType,
// })
// const comments = helpers.getEiCCommentsForHE({ newRecommendation })
// helpers.sendHandlingEditorEmail({
// email,
// comments,
// emailType,
// titleText,
// targetUserName,
// })
// }
// if (
// recommendationType === 'review' ||
// recommendation === 'return-to-handling-editor'
// ) {
// return
// }
// // when publishing, only send emails to authors if the manuscript has passed EQA
// if (isEditorInChief && (recommendation !== 'publish' || hasEQA)) {
// // send all authors email
// const emailType = helpers.getEmailTypeByRecommendationForAuthors({
// recommendation,
// hasPeerReview,
// })
// let comments
// if (hasPeerReview) {
// comments = helpers.getHEComments({
// heRecommendation: parsedFragment.heRecommendation,
// })
// } else {
// comments = newRecommendation.comments[0].content
// }
// const authors = helpers.getAllAuthors({
// comments,
// emailType,
// title: parsedFragment.title,
// fragmentAuthors: activeAuthors,
// })
// email = helpers.updateEmailContentForAllAuthors({
// email,
// eicName,
// customId,
// recommendation,
// })
// helpers.sendAuthorsEmail({ email, authors, baseUrl })
// }
// // send email to SA when the HE requests a revision
// if (collection.status === 'revisionRequested') {
// const authorNoteText = helpers.getPrivateNoteTextForAuthor({
// newRecommendation,
// })
// const author = helpers.getSubmittingAuthor({
// journalName,
// authorNoteText,
// submittingAuthor,
// title: parsedFragment.title,
// })
// email = helpers.updateEmailContentForSA({
// email,
// customId,
// signatureName: get(collection, 'handlingEditor.name', eicName),
// })
// helpers.sendSubmittingAuthorEmail({ email, author, baseUrl })
// }
// if (!hasPeerReview) {
// return
// }
// let reviewers = []
// if (isEditorInChief) {
// if (recommendation !== 'publish' || hasEQA) {
// email = helpers.updateEmailContentForReviewers({
// email,
// customId,
// recommendation,
// signatureName: eicName,
// })
// reviewers = await helpers.getSubmittedReviewers({
// UserModel,
// titleText,
// fragmentHelper,
// recommendation,
// })
// }
// } else {
// email = helpers.updateEmailContentForReviewers({
// email,
// customId,
// subject: `Review no longer required`,
// signatureName: get(collection, 'handlingEditor.name', eicName),
// })
// reviewers = await helpers.getNoResponseReviewers({
// UserModel,
// titleText,
// fragmentHelper,
// })
// helpers.sendEiCsEmail({
// email,
// baseUrl,
// customId,
// userHelper,
// recommendation: newRecommendation,
// targetUserName: collHelper.getHELastName(),
// titleText: `the submission "${parsedFragment.title}" by ${
// submittingAuthor.firstName
// } ${submittingAuthor.lastName}`,
// })
// }
// helpers.sendReviewersEmail({ email, baseUrl, reviewers })
// },
async sendNotificationsWhenEiCMakesDecision({
hasEQA,
baseUrl,
fragment,
UserModel,
collection,
targetUserName,
isEditorInChief,
newRecommendation,
}) {
const fragmentHelper = new Fragment({ fragment })
......@@ -57,14 +263,9 @@ module.exports = {
})
const { recommendation, recommendationType } = newRecommendation
// the EiC recommends to publish so an email to the EQA needs to be sent,
// one requesting approval or one informing them that the manuscript has been published
if (
isEditorInChief &&
recommendation === 'publish' &&
collection.technicalChecks.token
) {
if (recommendation === 'publish' && collection.technicalChecks.token) {
sendEQAEmail({
email,
eicName,
......@@ -79,14 +280,8 @@ module.exports = {
const { customId } = collection
const collHelper = new Collection({ collection })
// send HE emails when a review is submitted
// or when the EiC makes a recommendation after peer review
if (
recommendationType === 'review' ||
(isEditorInChief &&
hasPeerReview &&
(recommendation !== 'publish' || hasEQA))
) {
// send email to HE when the EiC makes a recommendation after peer review
if (hasPeerReview && (recommendation !== 'publish' || hasEQA)) {
const handlingEditor = get(collection, 'handlingEditor', {})
const heUser = await UserModel.find(handlingEditor.id)
email = helpers.updateEmailContentForHE({
......@@ -113,15 +308,8 @@ module.exports = {
})
}
if (
recommendationType === 'review' ||
recommendation === 'return-to-handling-editor'
) {
return
}
// when publishing, only send emails to authors if the manuscript has passed EQA
if (isEditorInChief && (recommendation !== 'publish' || hasEQA)) {
// when publishing, only send emails to authors and reviewer if the manuscript has passed EQA
if (recommendation !== 'publish' || hasEQA) {
// send all authors email
const emailType = helpers.getEmailTypeByRecommendationForAuthors({
recommendation,
......@@ -145,11 +333,64 @@ module.exports = {
})
email = helpers.updateEmailContentForAllAuthors({
email,
eicName,
customId,
recommendation,
})
helpers.sendAuthorsEmail({ email, authors, baseUrl })
email = helpers.updateEmailContentForReviewers({
email,
customId,
recommendation,
signatureName: eicName,
})
const reviewers = await helpers.getSubmittedReviewers({
UserModel,
titleText,
fragmentHelper,
recommendation,
})
helpers.sendReviewersEmail({ email, baseUrl, reviewers })
}
},
async sendNotificationsWhenHEMakesRecommendation({
baseUrl,
fragment,
UserModel,
collection,
newRecommendation,
}) {
const fragmentHelper = new Fragment({ fragment })
const parsedFragment = await fragmentHelper.getFragmentData({
handlingEditor: collection.handlingEditor,
})
const { submittingAuthor } = await fragmentHelper.getAuthorData({
UserModel,
})
const titleText = `The manuscript titled "${parsedFragment.title}" by ${
submittingAuthor.firstName
} ${submittingAuthor.lastName}`
const { customId } = collection
const collHelper = new Collection({ collection })
const userHelper = new User({ UserModel })
const eicName = await userHelper.getEiCName()
let email = new Email({
type: 'user',
content: {
signatureName: eicName,
unsubscribeLink: baseUrl,
ctaText: 'MANUSCRIPT DETAILS',
signatureJournal: journalName,
ctaLink: services.createUrl(
baseUrl,
`/projects/${collection.id}/versions/${fragment.id}/details`,
),
},
})
// send email to SA when the HE requests a revision
if (collection.status === 'revisionRequested') {
......@@ -171,106 +412,104 @@ module.exports = {
helpers.sendSubmittingAuthorEmail({ email, author, baseUrl })
}
const hasPeerReview = !isEmpty(collection.handlingEditor)
if (!hasPeerReview) {
return
}
let reviewers = []
if (isEditorInChief) {
if (recommendation !== 'publish' || hasEQA) {
email = helpers.updateEmailContentForReviewers({
email,
customId,
recommendation,
signatureName: eicName,
})
reviewers = await helpers.getSubmittedReviewers({
UserModel,
titleText,
fragmentHelper,
recommendation,
})
}
} else {
email = helpers.updateEmailContentForReviewers({
email,
customId,
subject: `Review no longer required`,
signatureName: get(collection, 'handlingEditor.name', eicName),
})
reviewers = await helpers.getNoResponseReviewers({
UserModel,
titleText,
fragmentHelper,
})
helpers.sendEiCsEmail({
email,
baseUrl,
customId,
userHelper,
recommendation: newRecommendation,
targetUserName: collHelper.getHELastName(),
titleText: `the submission "${parsedFragment.title}" by ${
submittingAuthor.firstName
} ${submittingAuthor.lastName}`,
})
}
email = helpers.updateEmailContentForReviewers({
email,
customId,
subject: `Review no longer required`,
signatureName: get(collection, 'handlingEditor.name', eicName),
})
const reviewers = await helpers.getNoResponseReviewers({
UserModel,
titleText,
fragmentHelper,
})
helpers.sendReviewersEmail({ email, baseUrl, reviewers })
helpers.sendEiCsEmail({
email,
baseUrl,
customId,
userHelper,
recommendation: newRecommendation,
targetUserName: collHelper.getHELastName(),
titleText: `the submission "${parsedFragment.title}" by ${
submittingAuthor.firstName
} ${submittingAuthor.lastName}`,
})
},
}
async sendNotificationsWhenReviewerSubmitsReport({
UserModel,
collection,
newRecommendation,
baseUrl,
fragment,
targetUserName,
}) {
const fragmentHelper = new Fragment({ fragment })
const parsedFragment = await fragmentHelper.getFragmentData({
handlingEditor: collection.handlingEditor,
})
const { submittingAuthor } = await fragmentHelper.getAuthorData({
UserModel,
})
const sendEQAEmail = ({
email,
eicName,
baseUrl,
titleText,
collection,
subjectBaseText,
}) => {
let emailType
switch (collection.status) {
case 'accepted':
emailType = 'eqa-manuscript-published'
email.content.subject = `${subjectBaseText} decision finalized`
break
case 'inQA':
emailType = 'eqa-manuscript-request-for-approval'
email.content.subject = `${subjectBaseText} Request for EQA Approval`
email.content.ctaLink = services.createUrl(
baseUrl,
config.get('eqa-decision.url'),
{
collectionId: collection.id,
customId: collection.customId,
token: collection.technicalChecks.token,
},
)
email.content.ctaText = 'MAKE DECISION'
break
default:
throw new Error(
`Cannot send EQA email when collection status is ${collection.status} `,
)
}
email.toUser = {
email: editorialAssistantEmail,
name: 'Editorial Assistant',
}
email.content.unsubscribeLink = baseUrl
email.content.signatureName = eicName
const { html, text } = email.getNotificationBody({
emailBodyProps: getEmailCopy({
const titleText = `The manuscript titled "${parsedFragment.title}" by ${
submittingAuthor.firstName
} ${submittingAuthor.lastName}`
const userHelper = new User({ UserModel })
const eicName = await userHelper.getEiCName()
let email = new Email({
type: 'user',
content: {
signatureName: eicName,
unsubscribeLink: baseUrl,
ctaText: 'MANUSCRIPT DETAILS',
signatureJournal: journalName,
ctaLink: services.createUrl(
baseUrl,
`/projects/${collection.id}/versions/${fragment.id}/details`,
),
},
})
const { recommendation, recommendationType } = newRecommendation
const handlingEditor = get(collection, 'handlingEditor', {})
const heUser = await UserModel.find(handlingEditor.id)
const { customId } = collection
const collHelper = new Collection({ collection })
email = helpers.updateEmailContentForHE({
email,
baseUrl,
eicName,
titleText,
customId,
recommendation,
recommendationType,
heLastName: collHelper.getHELastName(),
handlingEditor: heUser,
})
const emailType = helpers.getEmailTypeByRecommendationForHE({
recommendation,
recommendationType,
})
const comments = helpers.getEiCCommentsForHE({ newRecommendation })
helpers.sendHandlingEditorEmail({
email,
comments,
emailType,
customId: collection.customId,
}),
})
email.sendEmail({ html, text })
titleText,
targetUserName,
})
},
}
......@@ -4,7 +4,7 @@ const {
Collection,
} = require('pubsweet-component-helper-service')
const notifications = require('./notifications/notifications')
const Notification = require('./notifications/notification')
module.exports = models => async (req, res) => {
const { collectionId, fragmentId, recommendationId } = req.params
......@@ -48,16 +48,16 @@ module.exports = models => async (req, res) => {
recommendation.updatedOn = Date.now()
if (req.body.submittedOn) {
notifications.sendNotifications({
const notification = new Notification({
fragment,
UserModel,
collection,
isEditorInChief: false,
UserModel: models.User,
baseUrl: services.getBaseUrl(req),
newRecommendation: recommendation,
targetUserName: `${user.lastName}`,
})
notification.notifyHEWhenReviewerSubmitsReport(`${user.lastName}`)
if (['underReview'].includes(collection.status)) {
const collectionHelper = new Collection({ collection })
collectionHelper.updateStatus({ newStatus: 'reviewCompleted' })
......
......@@ -134,16 +134,25 @@ module.exports = models => async (req, res) => {
await collection.save()
}
notifications.sendNotifications({
hasEQA,
fragment,
collection,
isEditorInChief,
newRecommendation,
UserModel: models.User,
targetUserName: reqUser.lastName,
baseUrl: services.getBaseUrl(req),
})
if (isEditorInChief) {
notifications.sendNotificationsWhenEiCMakesDecision({
hasEQA,
fragment,
collection,
newRecommendation,
UserModel: models.User,
targetUserName: reqUser.lastName,
baseUrl: services.getBaseUrl(req),
})
} else {
notifications.sendNotificationsWhenHEMakesRecommendation({
fragment,
collection,
newRecommendation,
UserModel: models.User,
baseUrl: services.getBaseUrl(req),
})
}
}
fragment.recommendations.push(newRecommendation)
......
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