diff --git a/backend/src/middleware/helpers/email/templateBuilder.js b/backend/src/middleware/helpers/email/templateBuilder.js index 0a95f6dd3..bf174ef48 100644 --- a/backend/src/middleware/helpers/email/templateBuilder.js +++ b/backend/src/middleware/helpers/email/templateBuilder.js @@ -71,7 +71,7 @@ export const resetPasswordTemplate = ({ email, variables: { nonce, name } }) => } } -export const wrongAccountTemplate = ({ email }) => { +export const wrongAccountTemplate = ({ email, _variables = {} }) => { const subject = 'Falsche Mailadresse? | Wrong E-mail?' const actionUrl = new URL('/password-reset/request', CONFIG.CLIENT_URI) const renderParams = { ...defaultParams, englishHint, actionUrl } diff --git a/backend/src/middleware/login/loginMiddleware.js b/backend/src/middleware/login/loginMiddleware.js index f2f1cde7f..3cd2158c2 100644 --- a/backend/src/middleware/login/loginMiddleware.js +++ b/backend/src/middleware/login/loginMiddleware.js @@ -23,14 +23,14 @@ const sendPasswordResetMail = async (resolve, root, args, context, resolveInfo) const { email } = args const { email: userFound, nonce, name } = await resolve(root, args, context, resolveInfo) const template = userFound ? resetPasswordTemplate : wrongAccountTemplate - await sendMail(template({ email, nonce, name })) + await sendMail(template({ email, variables: { nonce, name } })) return true } const sendEmailVerificationMail = async (resolve, root, args, context, resolveInfo) => { const response = await resolve(root, args, context, resolveInfo) const { email, nonce, name } = response - await sendMail(emailVerificationTemplate({ email, nonce, name })) + await sendMail(emailVerificationTemplate({ email, variables: { nonce, name } })) delete response.nonce return response } diff --git a/backend/src/middleware/notifications/notificationsMiddleware.js b/backend/src/middleware/notifications/notificationsMiddleware.js index 5419771ea..a871605f7 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.js +++ b/backend/src/middleware/notifications/notificationsMiddleware.js @@ -44,7 +44,7 @@ const publishNotifications = async (context, promises) => { sendMail( notificationTemplate({ email: notificationsEmailAddresses[index].email, - notification: notificationAdded, + variables: { notification: notificationAdded }, }), ) }