Skip to content
Snippets Groups Projects
Commit 1b448e05 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

Merge branch 'hin-838-eic-name-missing' into 'develop'

fix(manuscript-manager): add proper signature name

See merge request !29
parents bcb17433 dbfe858b
No related branches found
No related tags found
2 merge requests!34Sprint 17 features,!29fix(manuscript-manager): add proper signature name
......@@ -72,7 +72,8 @@ class User {
async getEiCName() {
const editorsInChief = await this.getEditorsInChief()
const { firstName, lastName } = editorsInChief[0]
const firstName = get(editorsInChief, '0.firstName', 'Editor')
const lastName = get(editorsInChief, '0.lastName', 'in Chief')
return `${firstName} ${lastName}`
}
}
......
......@@ -33,12 +33,15 @@ module.exports = {
fragmentAuthors.submittingAuthor.firstName
} ${fragmentAuthors.submittingAuthor.lastName}`
const userHelper = new User({ UserModel })
const eicName = await userHelper.getEiCName()
const email = new Email({
type: 'user',
content: {
unsubscribeLink: baseUrl,
ctaText: 'MANUSCRIPT DETAILS',
signatureName: get(collection, 'handlingEditor.name', 'N/A'),
signatureName: eicName,
ctaLink: services.createUrl(
baseUrl,
`/projects/${collection.id}/versions/${fragment.id}/details`,
......@@ -46,8 +49,6 @@ module.exports = {
},
})
const userHelper = new User({ UserModel })
let comments
if (isEditorInChief) {
const eicComments = chain(newRecommendation)
......@@ -95,6 +96,7 @@ module.exports = {
isEditorInChief,
subjectBaseText,
newRecommendation,
handlingEditorName: get(collection, 'handlingEditor.name', eicName),
})
}
if (hasPeerReview(collection)) {
......@@ -163,7 +165,7 @@ const sendHandlingEditorEmail = ({
email.content.unsubscribeLink = services.createUrl(baseUrl, unsubscribeSlug, {
id: handlingEditor.id,
})
email.content.signatureName = eicName
const { html, text } = email.getBody({
body: getEmailCopy({
emailType,
......@@ -183,6 +185,7 @@ const sendAuthorsEmail = async ({
subjectBaseText,
fragmentAuthors,
newRecommendation,
handlingEditorName,
parsedFragment: { heRecommendation },
}) => {
let emailType, authors, comments
......@@ -216,7 +219,10 @@ const sendAuthorsEmail = async ({
}))
} else {
emailType = 'author-request-to-revision'
email.content.subject = `${subjectBaseText} Recommendation`
email.content.signatureName = handlingEditorName
const authorNote = newRecommendation.comments.find(comm => comm.public)
const content = get(authorNote, 'content')
const authorNoteText = content ? `Reason & Details: "${content}"` : ''
......@@ -285,7 +291,6 @@ const sendReviewersEmail = async ({
titleText,
}),
}))
email.content.signatureName = eicName
} else {
email.content.signatureName = handlingEditorName
email.content.subject = `${subjectBaseText} ${getSubjectByRecommendation(
......
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