diff --git a/backend/src/middleware/helpers/email/templateBuilder.js b/backend/src/middleware/helpers/email/templateBuilder.js index dd4985327..0d9972c76 100644 --- a/backend/src/middleware/helpers/email/templateBuilder.js +++ b/backend/src/middleware/helpers/email/templateBuilder.js @@ -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 }), } } diff --git a/backend/src/middleware/helpers/email/templates/de/notification.html b/backend/src/middleware/helpers/email/templates/de/notification.html index 24e2257e0..1c8092f9d 100644 --- a/backend/src/middleware/helpers/email/templates/de/notification.html +++ b/backend/src/middleware/helpers/email/templates/de/notification.html @@ -1,3 +1,4 @@ + diff --git a/backend/src/middleware/helpers/email/templates/en/notification.html b/backend/src/middleware/helpers/email/templates/en/notification.html index d32a7aecf..bd4cbb8a7 100644 --- a/backend/src/middleware/helpers/email/templates/en/notification.html +++ b/backend/src/middleware/helpers/email/templates/en/notification.html @@ -1,3 +1,4 @@ +