Skip to content
Snippets Groups Projects

Hin 1244 added users emails

Merged Alexandru Munteanu requested to merge HIN-1244-added-users-emails into develop
6 files
+ 24
22
Compare changes
  • Side-by-side
  • Inline
Files
6
const config = require('config')
const journalName = config.get('journal.name')
const getEmailCopy = ({ emailType, role }) => {
const getEmailCopyForUsersAddedByAdmin = ({ role }) => {
let paragraph
let hasIntro = true
let hasSignature = true
switch (emailType) {
case 'user-signup':
paragraph = `Thank you for creating an account on Hindawi’s review system.
To submit a manuscript and access your dashboard, please confirm your account by clicking on the link below.`
break
case 'user-added-by-admin':
const hasSignature = true
switch (role) {
case 'admin':
hasIntro = false
hasSignature = false
paragraph = `You have been invited to join Hindawi as a ${role}.
paragraph = `You have been invited to join Hindawi as an Administrator.
Please confirm your account and set your account details by clicking on the link below.`
break
case 'editorInChief':
paragraph = `You have been invited to join Hindawi as an Editor in Chief.
Please confirm your account and set your account details by clicking on the link below.`
break
case 'he-added-by-admin':
case 'handlingEditor':
paragraph = `You have been invited to become an Academic Editor for the journal ${journalName}.
To begin performing your editorial duties, you will need to create an account on Hindawi’s review system.<br/><br/>
Please confirm your account details by clicking on the link below.`
break
default:
throw new Error(`The ${emailType} email type is not defined.`)
paragraph = `You have been invited to join Hindawi as an Author.
Please confirm your account and set your account details by clicking on the link below.`
}
return { paragraph, hasLink: true, hasIntro, hasSignature }
}
module.exports = {
getEmailCopy,
getEmailCopyForUsersAddedByAdmin,
}