diff --git a/packages/component-email-templating/src/EmailTemplate.js b/packages/component-email-templating/src/EmailTemplate.js index 0887072c95cc482a2e3eee39c21d39fe27af2dd5..f703ae47075848647300e9269013a21cf692b930 100644 --- a/packages/component-email-templating/src/EmailTemplate.js +++ b/packages/component-email-templating/src/EmailTemplate.js @@ -58,7 +58,7 @@ class EmailTemplate { replacements: { ...configData, ...this.content, - ...emailBodyProps, + ...this.bodyProps, toEmail: this.toUser.email, toUserName: this.toUser.name, }, @@ -69,28 +69,31 @@ class EmailTemplate { } } - _getNotificationBody({ emailBodyProps }) { + _getNotificationBody() { return { html: htmlTemplateService.getCompiledNotificationBody({ replacements: { ...configData, ...this.content, - ...emailBodyProps, + ...this.bodyProps, toEmail: this.toUser.email, toUserName: this.toUser.name, }, }), - text: `${emailBodyProps.paragraph} ${this.content.ctaLink} ${ + text: `${this.content.paragraph} ${this.content.ctaLink} ${ this.content.ctaText } ${this.content.signatureName}`, } } + _getEmailTemplate() { + return this.templateType === 'notification' + ? this._getNotificationBody() + : this._getInvitationBody() + } + async sendEmail() { - const { html, text } = - this.templateType === 'notification' - ? this._getNotificationBody() - : this._getInvitationBody() + const { html, text } = this._getEmailTemplate() const { fromEmail: from } = this const { email: to } = this.toUser diff --git a/packages/component-email-templating/tests/helpers.test.js b/packages/component-email-templating/tests/HTMLTemplateService.test.js similarity index 100% rename from packages/component-email-templating/tests/helpers.test.js rename to packages/component-email-templating/tests/HTMLTemplateService.test.js