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 }) => {
|
export const notificationTemplate = ({ email, notification }) => {
|
||||||
// TODO Wolle language
|
|
||||||
const subject = `${CONFIG.APPLICATION_NAME} – Benachrichtigung | Notification`
|
|
||||||
const actionUrl = new URL('/notifications', CONFIG.CLIENT_URI)
|
const actionUrl = new URL('/notifications', CONFIG.CLIENT_URI)
|
||||||
|
const renderParams = { ...defaultParams, name: notification.to.name, actionUrl }
|
||||||
let content
|
let content
|
||||||
switch (notification.to.locale) {
|
switch (notification.to.locale) {
|
||||||
case 'de':
|
case 'de':
|
||||||
@ -122,24 +121,19 @@ export const notificationTemplate = ({ email, notification }) => {
|
|||||||
content = templatesEN.notification
|
content = templatesEN.notification
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
const subjectUnrendered = content.split('\n')[0].split('"')[1]
|
||||||
|
const subject = mustache.render(subjectUnrendered, renderParams, {})
|
||||||
|
// Wolle console.log('subject: ', subject)
|
||||||
|
|
||||||
// Wolle
|
// Wolle
|
||||||
// console.log(
|
// console.log(
|
||||||
// mustache.render(
|
// mustache.render(templates.layout, renderParams, { content }),
|
||||||
// templates.layout,
|
|
||||||
// { ...defaultParams, name: notification.to.name, actionUrl },
|
|
||||||
// { content },
|
|
||||||
// ),
|
|
||||||
// )
|
// )
|
||||||
|
|
||||||
return {
|
return {
|
||||||
from,
|
from,
|
||||||
to: email,
|
to: email,
|
||||||
subject,
|
subject,
|
||||||
html: mustache.render(
|
html: mustache.render(templates.layout, renderParams, { content }),
|
||||||
templates.layout,
|
|
||||||
{ ...defaultParams, name: notification.to.name, actionUrl },
|
|
||||||
{ content },
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<!-- emailSubject: "{{APPLICATION_NAME}} – Benachrichtigung" -->
|
||||||
<!-- Email Body German : BEGIN -->
|
<!-- Email Body German : BEGIN -->
|
||||||
<table class="email-german" align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"
|
<table class="email-german" align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"
|
||||||
style="margin: auto;">
|
style="margin: auto;">
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<!-- emailSubject: "{{APPLICATION_NAME}} – Notification" -->
|
||||||
<!-- Email Body English : BEGIN -->
|
<!-- Email Body English : BEGIN -->
|
||||||
<table class="email-german" align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"
|
<table class="email-german" align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"
|
||||||
style="margin: auto;">
|
style="margin: auto;">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user