mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Translate e-mail subject
This commit is contained in:
parent
d8b23d9df2
commit
a87cc524a6
@ -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 }),
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;">
|
||||
|
||||
@ -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;">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user