mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Cleanup
This commit is contained in:
parent
e58b452a7d
commit
a836872471
@ -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) => {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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),
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user