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

fix(AuthorEmailHERemoved): Removed title variable in favour of titleText

parent 1870e69c
No related branches found
No related tags found
3 merge requests!196S25 - EiC submit revision,!189S25,!170feat(AuthorEmailHERemoved): Created email template and code for sending it
...@@ -3,13 +3,7 @@ const config = require('config') ...@@ -3,13 +3,7 @@ const config = require('config')
const staffEmail = config.get('journal.staffEmail') const staffEmail = config.get('journal.staffEmail')
const journalName = config.get('journal.name') const journalName = config.get('journal.name')
const getEmailCopy = ({ const getEmailCopy = ({ emailType, titleText, targetUserName, comments }) => {
emailType,
titleText,
targetUserName,
comments,
title,
}) => {
let paragraph let paragraph
let hasLink = true let hasLink = true
let hasIntro = true let hasIntro = true
...@@ -45,7 +39,7 @@ const getEmailCopy = ({ ...@@ -45,7 +39,7 @@ const getEmailCopy = ({
hasIntro = true hasIntro = true
hasLink = false hasLink = false
hasSignature = true hasSignature = true
paragraph = `The handling editor of your manuscript "${title}" had to be replaced. This may cause some delays in the peer review process.<br/><br/> paragraph = `The handling editor of your manuscript "${titleText}" had to be replaced. This may cause some delays in the peer review process.<br/><br/>
Thank you for your submission to ${journalName}.` Thank you for your submission to ${journalName}.`
break break
default: default:
......
...@@ -81,7 +81,7 @@ module.exports = { ...@@ -81,7 +81,7 @@ module.exports = {
const fragmentId = last(collection.fragments) const fragmentId = last(collection.fragments)
const fragment = await FragmentModel.find(fragmentId) const fragment = await FragmentModel.find(fragmentId)
const fragmentHelper = new Fragment({ fragment }) const fragmentHelper = new Fragment({ fragment })
const { title } = await fragmentHelper.getFragmentData() const { title: titleText } = await fragmentHelper.getFragmentData()
const { submittingAuthor } = await fragmentHelper.getAuthorData({ const { submittingAuthor } = await fragmentHelper.getAuthorData({
UserModel, UserModel,
}) })
...@@ -89,8 +89,6 @@ module.exports = { ...@@ -89,8 +89,6 @@ module.exports = {
submittingAuthor.lastName submittingAuthor.lastName
}` }`
const titleText = title
const userHelper = new User({ UserModel }) const userHelper = new User({ UserModel })
const eics = await userHelper.getEditorsInChief() const eics = await userHelper.getEditorsInChief()
const eic = eics[0] const eic = eics[0]
...@@ -98,7 +96,6 @@ module.exports = { ...@@ -98,7 +96,6 @@ module.exports = {
const { customId } = collection const { customId } = collection
const { paragraph, ...bodyProps } = getEmailCopy({ const { paragraph, ...bodyProps } = getEmailCopy({
title,
titleText, titleText,
targetUserName: submittingAuthorName, targetUserName: submittingAuthorName,
emailType: 'author-he-removed', emailType: 'author-he-removed',
......
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