mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: user handlebars as template engine for mailing & remove ejs
This commit is contained in:
committed by
Mohamed Marrouchi
parent
6f02cf1443
commit
ba4305a5c2
@@ -71,7 +71,15 @@ const i18nOptions: I18nOptions = {
|
||||
debug: false,
|
||||
}),
|
||||
template: {
|
||||
adapter: new MjmlAdapter('ejs', { inlineCssEnabled: false }),
|
||||
adapter: new MjmlAdapter(
|
||||
'handlebars',
|
||||
{
|
||||
inlineCssEnabled: false,
|
||||
},
|
||||
{
|
||||
handlebar: {},
|
||||
},
|
||||
),
|
||||
dir: path.join(process.cwd(), 'dist', 'templates'),
|
||||
options: {
|
||||
context: {
|
||||
|
||||
@@ -2,34 +2,38 @@
|
||||
<mj-body>
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-image width="186px" src="https://hexabot.ai/assets/images/logo.png"></mj-image>
|
||||
<mj-image
|
||||
width="186px"
|
||||
src="https://hexabot.ai/assets/images/logo.png"
|
||||
></mj-image>
|
||||
<mj-divider border-color="#000"></mj-divider>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('hi') %> <%= first_name %>,</mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('account_successfully_created_confirm_password') %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'hi'}} {{first_name}},
|
||||
</mj-text>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'account_successfully_created_confirm_password'}}
|
||||
</mj-text>
|
||||
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('confirm_account') %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'confirm_account'}}
|
||||
</mj-text>
|
||||
<mj-button
|
||||
href="<%= this.appUrl %>/login/<%= token %>"
|
||||
href="{{appUrl}}/login/{{token}}"
|
||||
font-size="16px"
|
||||
background-color="#000"
|
||||
><%= t('confirm') %></mj-button
|
||||
>
|
||||
{{t 'confirm'}}
|
||||
</mj-button>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('best_regards') %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= this.appName %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'best_regards'}}
|
||||
</mj-text>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{appName}}
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
</mj-body>
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
<mj-body>
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-image width="186px" src="https://hexabot.ai/assets/images/logo.png"></mj-image>
|
||||
<mj-image
|
||||
width="186px"
|
||||
src="https://hexabot.ai/assets/images/logo.png"
|
||||
></mj-image>
|
||||
<mj-divider border-color="#000"></mj-divider>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
<%= t('welcome') %>,
|
||||
{{t 'welcome'}}
|
||||
</mj-text>
|
||||
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'invitation_for_account_creation'}} {{appName}} {{t 'account'}}.
|
||||
</mj-text>
|
||||
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= `${t('invitation_for_account_creation')} ${this.appName}
|
||||
${t('account')}.` %></mj-text
|
||||
>
|
||||
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('create_account') %></mj-text
|
||||
>{{ t 'create_account'}}</mj-text
|
||||
>
|
||||
<mj-button
|
||||
href="<%= this.appUrl %>/register/<%= token %>"
|
||||
href="{{appUrl}}/register/{{token}}"
|
||||
font-size="16px"
|
||||
background-color="#000"
|
||||
><%= t('join') %></mj-button
|
||||
>
|
||||
{{t 'join'}}</mj-button
|
||||
>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('best_regards') %></mj-text
|
||||
>
|
||||
>{{t 'best_regards'}}
|
||||
</mj-text>
|
||||
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= this.appName %></mj-text
|
||||
>{{this.appName }}</mj-text
|
||||
>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
|
||||
@@ -2,33 +2,37 @@
|
||||
<mj-body>
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-image width="186px" src="https://hexabot.ai/assets/images/logo.png"></mj-image>
|
||||
<mj-image
|
||||
width="186px"
|
||||
src="https://hexabot.ai/assets/images/logo.png"
|
||||
></mj-image>
|
||||
<mj-divider border-color="#000"></mj-divider>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('hi') %> <%= first_name %>,</mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('password_reset_request') %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('click_to_reset_password') %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'hi'}} {{first_name}},
|
||||
</mj-text>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'password_reset_request'}}
|
||||
</mj-text>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'click_to_reset_password'}}
|
||||
</mj-text>
|
||||
<mj-button
|
||||
href="<%= this.appUrl %>/reset/<%= token %>"
|
||||
href="{{appUrl}}/reset/{{token}}"
|
||||
font-size="16px"
|
||||
background-color="#000"
|
||||
><%= t('reset') %></mj-button
|
||||
>
|
||||
{{t 'reset'}}
|
||||
</mj-button>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= t('best_regards') %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica"
|
||||
><%= this.appName %></mj-text
|
||||
>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{t 'best_regards'}}
|
||||
</mj-text>
|
||||
<mj-text font-size="16px" color="#000" font-family="helvetica">
|
||||
{{appName}}
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
</mj-body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
|
||||
Reference in New Issue
Block a user