Add i18n support to email-templates
The email-templates package now uses the i18n (internationalization) library to translate email content based on user language preferences. This update involves changes to the email structure, the addition of translation JSON files, and modifications to the files referencing the emails. Email file locations were also restructured for better organization.
This commit is contained in:
@@ -103,7 +103,7 @@ class AccountInvitationsWebhookService {
|
||||
|
||||
const mailer = await getMailer();
|
||||
|
||||
const html = renderInviteEmail({
|
||||
const { html, subject } = await renderInviteEmail({
|
||||
link: this.getInvitationLink(invitation.invite_token),
|
||||
invitedUserEmail: invitation.email,
|
||||
inviter: inviter.data.name ?? inviter.data.email ?? '',
|
||||
@@ -115,7 +115,7 @@ class AccountInvitationsWebhookService {
|
||||
.sendEmail({
|
||||
from: env.emailSender,
|
||||
to: invitation.email,
|
||||
subject: 'You have been invited to join a team',
|
||||
subject,
|
||||
html,
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -55,7 +55,7 @@ class AccountWebhooksService {
|
||||
const { getMailer } = await import('@kit/mailers');
|
||||
const mailer = await getMailer();
|
||||
|
||||
const html = renderAccountDeleteEmail({
|
||||
const { html, subject } = await renderAccountDeleteEmail({
|
||||
userDisplayName: params.userDisplayName,
|
||||
productName: params.productName,
|
||||
});
|
||||
@@ -63,7 +63,7 @@ class AccountWebhooksService {
|
||||
return mailer.sendEmail({
|
||||
to: params.userEmail,
|
||||
from: params.fromEmail,
|
||||
subject: 'Account Deletion Request',
|
||||
subject,
|
||||
html,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user