const getEmailCopy = ({ emailType, titleText }) => { let paragraph switch (emailType) { case 'author-added-to-manuscript': paragraph = `You have been added as an author to ${titleText}. The manuscript will become visible on your dashboard once it's submitted. Please click on the link below to access your dashboard.` break case 'new-author-added-to-manuscript': paragraph = `You have been added as an author to ${titleText}. In order to gain access to the manuscript, please confirm your account and set your account details by clicking on the link below.` break default: throw new Error(`The ${emailType} email type is not defined.`) } return { paragraph, hasLink: true } } module.exports = { getEmailCopy, }