diff --git a/packages/component-manuscript-manager/src/routes/fragments/notifications/emailCopy.js b/packages/component-manuscript-manager/src/routes/fragments/notifications/emailCopy.js index b48925f983d296cd88f78d43abd65a0cd633f845..64f10e4fc62bc24ca139281b489037818d93ec55 100644 --- a/packages/component-manuscript-manager/src/routes/fragments/notifications/emailCopy.js +++ b/packages/component-manuscript-manager/src/routes/fragments/notifications/emailCopy.js @@ -18,9 +18,6 @@ const getEmailCopy = ({ emailType, titleText, expectedDate, customId }) => { To download the updated PDF and proceed with the review process, please visit the manuscript details page.<br/><br/> Thank you again for reviewing for ${journalName}.` break - // case 'eic-manuscript-submitted': - // paragraph = `A new manuscript has been submitted. You can view ${titleText} and take further actions by clicking on the following link:` - // break case 'eqs-manuscript-submitted': paragraph = `Manuscript ID ${customId} has been submitted and a package has been sent. Please click on the link below to either approve or reject the manuscript:` break diff --git a/packages/component-manuscript-manager/src/routes/fragments/notifications/notifications.js b/packages/component-manuscript-manager/src/routes/fragments/notifications/notifications.js index bd78d0169c9fadd3bf210d07f64f7f20c8af2b84..6bc45b44d8bac714bf47b37867d0edd0cbd61eeb 100644 --- a/packages/component-manuscript-manager/src/routes/fragments/notifications/notifications.js +++ b/packages/component-manuscript-manager/src/routes/fragments/notifications/notifications.js @@ -1,9 +1,9 @@ const config = require('config') const { get } = require('lodash') +const Email = require('@pubsweet/component-email-templating') const { User, - Email, services, Fragment, } = require('pubsweet-component-helper-service') @@ -122,8 +122,8 @@ const sendHandlingEditorEmail = ({ email.content.signatureName = eicName email.content.subject = `${customId}: Revision submitted` - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType, titleText: `the manuscript titled ${title}`, }), @@ -162,8 +162,8 @@ const sendReviewersEmail = async ({ }, ) - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType, titleText: `the manuscript titled ${title}`, expectedDate: services.getExpectedDate({ daysExpected: 14 }), @@ -196,8 +196,8 @@ const sendEQSEmail = ({ email, eicName, baseUrl, collection }) => { ) email.content.ctaText = 'MAKE DECISION' - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType, customId: collection.customId, }), @@ -273,8 +273,8 @@ const sendAuthorsEmail = async ({ email.content.ctaText = 'CONFIRM ACCOUNT' } - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: author.paragraph, hasLink: author.hasLink, hasIntro: author.hasIntro, diff --git a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/helpers.js b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/helpers.js index 3dc8b8d7741c96ffa742617b424673b1a0b31e03..c03dedb12bd798664f0d1855fcd4af9cb2f345fb 100644 --- a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/helpers.js +++ b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/helpers.js @@ -22,8 +22,8 @@ module.exports = { token: reviewer.accessTokens.unsubscribe, }, ) - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: reviewer.paragraph, hasLink: reviewer.hasLink, hasIntro: reviewer.hasIntro, @@ -108,8 +108,8 @@ module.exports = { titleText, targetUserName, }) => { - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType, titleText, comments, @@ -246,8 +246,8 @@ module.exports = { email: eic.email, name: `${eic.firstName} ${eic.lastName}`, } - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: eic.paragraph, hasLink: eic.hasLink, hasIntro: eic.hasIntro, @@ -271,8 +271,8 @@ module.exports = { token: author.accessTokens.unsubscribe, }, ) - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: author.paragraph, hasLink: author.hasLink, hasIntro: author.hasIntro, @@ -353,8 +353,8 @@ module.exports = { token: author.accessTokens.unsubscribe, }, ) - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: author.paragraph, hasLink: author.hasLink, hasIntro: author.hasIntro, diff --git a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js index c930744e70e8db6829fb9423a52f78066b133b71..671d197e95fca8646e7086c9bea663262a142009 100644 --- a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js +++ b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js @@ -1,9 +1,9 @@ const config = require('config') const { get, isEmpty } = require('lodash') +const Email = require('@pubsweet/component-email-templating') const { User, - Email, services, Fragment, Collection, @@ -254,8 +254,8 @@ const sendEQAEmail = ({ email.content.unsubscribeLink = baseUrl email.content.signatureName = eicName - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ eicName, titleText, emailType, diff --git a/packages/component-manuscript-manager/src/routes/technicalChecks/notifications/notifications.js b/packages/component-manuscript-manager/src/routes/technicalChecks/notifications/notifications.js index a51cf5e2b78b9f40d44a95d6c7e4898e9497bd76..282602932972bee32378fb94d31a38913b8639a6 100644 --- a/packages/component-manuscript-manager/src/routes/technicalChecks/notifications/notifications.js +++ b/packages/component-manuscript-manager/src/routes/technicalChecks/notifications/notifications.js @@ -126,8 +126,8 @@ const sendEditorsEmail = async ({ email: eic.email, name: `${eic.firstName} ${eic.lastName}`, } - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: eic.paragraph, hasLink: eic.hasLink, hasIntro: eic.hasIntro, @@ -156,8 +156,8 @@ const sendHandlingEditorEmail = ({ id: handlingEditor.id, }) - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType, titleText, }), @@ -198,8 +198,11 @@ const sendSubmittedReviewersEmail = async ({ id: reviewer.id, }, ) - const { html, text } = email.getBody({ - body: { paragraph: reviewer.paragraph, hasLink: reviewer.hasLink }, + const { html, text } = email.getNotificationBody({ + emailBodyProps: { + paragraph: reviewer.paragraph, + hasLink: reviewer.hasLink, + }, }) email.sendEmail({ html, text }) }) @@ -235,8 +238,8 @@ const sendAuthorsEmail = ({ id: author.id, }, ) - const { html, text } = email.getBody({ - body: { + const { html, text } = email.getNotificationBody({ + emailBodyProps: { paragraph: author.paragraph, hasLink: author.hasLink, }, diff --git a/packages/component-user-manager/src/routes/fragmentsUsers/emails/notifications.js b/packages/component-user-manager/src/routes/fragmentsUsers/emails/notifications.js index 26bf63b940fc1a4511342026a5a948873ee0d6e3..70fc4ac92d797cf7032a06719123184d7ef85999 100644 --- a/packages/component-user-manager/src/routes/fragmentsUsers/emails/notifications.js +++ b/packages/component-user-manager/src/routes/fragmentsUsers/emails/notifications.js @@ -62,8 +62,8 @@ module.exports = { email.content.ctaText = 'CONFIRM ACCOUNT' } - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType: 'submitting-author-added-by-admin', titleText, }), diff --git a/packages/component-user-manager/src/routes/users/emails/notifications.js b/packages/component-user-manager/src/routes/users/emails/notifications.js index 461584e1983ee428a48d9336d4c774333a57307e..c68f35f2bcab3790a19f4fcb5592d6fa87ef39a9 100644 --- a/packages/component-user-manager/src/routes/users/emails/notifications.js +++ b/packages/component-user-manager/src/routes/users/emails/notifications.js @@ -36,8 +36,8 @@ const sendForgotPasswordEmail = ({ email, baseUrl, user }) => { token: user.accessTokens.unsubscribe, }) - const { html, text } = email.getBody({ - body: getEmailCopy({ + const { html, text } = email.getNotificationBody({ + emailBodyProps: getEmailCopy({ emailType: 'user-forgot-password', }), })