Translate e-mail subject

This commit is contained in:
Wolfgang Huß 2021-09-23 14:04:58 +02:00
parent d8b23d9df2
commit a87cc524a6
3 changed files with 8 additions and 12 deletions

View File

@ -106,9 +106,8 @@ export const wrongAccountTemplate = ({ email }) => {
}
export const notificationTemplate = ({ email, notification }) => {
// TODO Wolle language
const subject = `${CONFIG.APPLICATION_NAME} Benachrichtigung | Notification`
const actionUrl = new URL('/notifications', CONFIG.CLIENT_URI)
const renderParams = { ...defaultParams, name: notification.to.name, actionUrl }
let content
switch (notification.to.locale) {
case 'de':
@ -122,24 +121,19 @@ export const notificationTemplate = ({ email, notification }) => {
content = templatesEN.notification
break
}
const subjectUnrendered = content.split('\n')[0].split('"')[1]
const subject = mustache.render(subjectUnrendered, renderParams, {})
// Wolle console.log('subject: ', subject)
// Wolle
// console.log(
// mustache.render(
// templates.layout,
// { ...defaultParams, name: notification.to.name, actionUrl },
// { content },
// ),
// mustache.render(templates.layout, renderParams, { content }),
// )
return {
from,
to: email,
subject,
html: mustache.render(
templates.layout,
{ ...defaultParams, name: notification.to.name, actionUrl },
{ content },
),
html: mustache.render(templates.layout, renderParams, { content }),
}
}

View File

@ -1,3 +1,4 @@
<!-- emailSubject: "{{APPLICATION_NAME}} Benachrichtigung" -->
<!-- Email Body German : BEGIN -->
<table class="email-german" align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"
style="margin: auto;">

View File

@ -1,3 +1,4 @@
<!-- emailSubject: "{{APPLICATION_NAME}} Notification" -->
<!-- Email Body English : BEGIN -->
<table class="email-german" align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"
style="margin: auto;">