diff --git a/packages/component-email-templating/README.md b/packages/component-email-templating/README.md index 7bb4beb6968da7e1f6eea8f912d37369b15c8786..e7472d690850cdd5d4a60e582965955e6def08c6 100644 --- a/packages/component-email-templating/README.md +++ b/packages/component-email-templating/README.md @@ -56,13 +56,15 @@ The `Email` class also provides a `constructor` whose properties will be used wh  ```javascript - const emailTemplate = require('@pubsweet/component-email-template') + const EmailTemplate = require('@pubsweet/component-email-template') const config = require('config') const { name: journalName, fromEmail: staffEmail } = config.get('journal') + + const paragraph = `We are please to inform you that the manuscript has passed the technical check process and is now submitted. Please click the link below to access the manuscript.` const sendNotifications = ({ user, editor, collection, fragment }) => { - const email = new emailTemplate({ + const email = new EmailTemplate({ type: 'user', fromEmail, toUser: { @@ -74,18 +76,19 @@ The `Email` class also provides a `constructor` whose properties will be used wh signatureJournal: journalName, signatureName: `${editor.name}`, subject: `${collection.customId}: Manuscript Update`, + paragraph, unsubscribeLink: `http://localhost:3000/unsubscribe/${user.id}`, ctaLink: `http://localhost:3000/projects/${collection.id}/versions/${ fragment.id }/details`, }, + bodyProps: { + hasLink: true, + hasIntro: true, + hasSignature: true } }) - const paragraph = `We are please to inform you that the manuscript has passed the technical check process and is now submitted. Please click the link below to access the manuscript.` - - const { html, text } = email.getNotificationBody({ emailBodyProps: { paragraph, hasLink: true, hasIntro: true, hasSignature: true }}) - - email.sendEmail({ html, text }) + email.sendEmail() } ```