This commit is contained in:
Wolfgang Huß 2021-09-27 12:36:58 +02:00
parent e58b452a7d
commit a836872471
3 changed files with 3 additions and 17 deletions

View File

@ -9,7 +9,7 @@ let sendMailCallback = async () => {}
if (!hasEmailConfig) {
if (!CONFIG.TEST) {
// eslint-disable-next-line no-console
console.log('Warning: Middlewares will not try to send mails.') // Wolle
console.log('Warning: Middlewares will not try to send mails.')
}
} else {
sendMailCallback = async (templateArgs) => {

View File

@ -68,15 +68,6 @@ export const resetPasswordTemplate = ({ email, nonce, name }) => {
actionUrl.searchParams.set('nonce', nonce)
actionUrl.searchParams.set('email', email)
// Wolle
// console.log(
// mustache.render(
// templates.layout,
// { ...defaultParams, englishHint, actionUrl, name, nonce, subject },
// { content: templates.passwordReset },
// ),
// )
return {
from,
to: email,
@ -123,10 +114,6 @@ export const notificationTemplate = ({ email, notification }) => {
}
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, renderParams, { content }))
return {
from,

View File

@ -4,8 +4,7 @@ import { validateNotifyUsers } from '../validation/validationMiddleware'
import { sendMail } from '../helpers/email/sendMail'
import { notificationTemplate } from '../helpers/email/templateBuilder'
// Wolle -> queryNotificationEmails
const queryNotificationsEmails = async (context, notificationUserIds) => {
const queryNotificationEmails = async (context, notificationUserIds) => {
if (!(notificationUserIds && notificationUserIds.length)) return []
const userEmailCypher = `
MATCH (user: User)
@ -35,7 +34,7 @@ const queryNotificationsEmails = async (context, notificationUserIds) => {
const publishNotifications = async (context, promises) => {
let notifications = await Promise.all(promises)
notifications = notifications.flat()
const notificationsEmailAddresses = await queryNotificationsEmails(
const notificationsEmailAddresses = await queryNotificationEmails(
context,
notifications.map((notification) => notification.to.id),
)