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 (!hasEmailConfig) {
|
||||||
if (!CONFIG.TEST) {
|
if (!CONFIG.TEST) {
|
||||||
// eslint-disable-next-line no-console
|
// 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 {
|
} else {
|
||||||
sendMailCallback = async (templateArgs) => {
|
sendMailCallback = async (templateArgs) => {
|
||||||
|
|||||||
@ -68,15 +68,6 @@ export const resetPasswordTemplate = ({ email, nonce, name }) => {
|
|||||||
actionUrl.searchParams.set('nonce', nonce)
|
actionUrl.searchParams.set('nonce', nonce)
|
||||||
actionUrl.searchParams.set('email', email)
|
actionUrl.searchParams.set('email', email)
|
||||||
|
|
||||||
// Wolle
|
|
||||||
// console.log(
|
|
||||||
// mustache.render(
|
|
||||||
// templates.layout,
|
|
||||||
// { ...defaultParams, englishHint, actionUrl, name, nonce, subject },
|
|
||||||
// { content: templates.passwordReset },
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
from,
|
from,
|
||||||
to: email,
|
to: email,
|
||||||
@ -123,10 +114,6 @@ export const notificationTemplate = ({ email, notification }) => {
|
|||||||
}
|
}
|
||||||
const subjectUnrendered = content.split('\n')[0].split('"')[1]
|
const subjectUnrendered = content.split('\n')[0].split('"')[1]
|
||||||
const subject = mustache.render(subjectUnrendered, renderParams, {})
|
const subject = mustache.render(subjectUnrendered, renderParams, {})
|
||||||
// Wolle console.log('subject: ', subject)
|
|
||||||
|
|
||||||
// Wolle
|
|
||||||
// console.log(mustache.render(templates.layout, renderParams, { content }))
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
from,
|
from,
|
||||||
|
|||||||
@ -4,8 +4,7 @@ import { validateNotifyUsers } from '../validation/validationMiddleware'
|
|||||||
import { sendMail } from '../helpers/email/sendMail'
|
import { sendMail } from '../helpers/email/sendMail'
|
||||||
import { notificationTemplate } from '../helpers/email/templateBuilder'
|
import { notificationTemplate } from '../helpers/email/templateBuilder'
|
||||||
|
|
||||||
// Wolle -> queryNotificationEmails
|
const queryNotificationEmails = async (context, notificationUserIds) => {
|
||||||
const queryNotificationsEmails = async (context, notificationUserIds) => {
|
|
||||||
if (!(notificationUserIds && notificationUserIds.length)) return []
|
if (!(notificationUserIds && notificationUserIds.length)) return []
|
||||||
const userEmailCypher = `
|
const userEmailCypher = `
|
||||||
MATCH (user: User)
|
MATCH (user: User)
|
||||||
@ -35,7 +34,7 @@ const queryNotificationsEmails = async (context, notificationUserIds) => {
|
|||||||
const publishNotifications = async (context, promises) => {
|
const publishNotifications = async (context, promises) => {
|
||||||
let notifications = await Promise.all(promises)
|
let notifications = await Promise.all(promises)
|
||||||
notifications = notifications.flat()
|
notifications = notifications.flat()
|
||||||
const notificationsEmailAddresses = await queryNotificationsEmails(
|
const notificationsEmailAddresses = await queryNotificationEmails(
|
||||||
context,
|
context,
|
||||||
notifications.map((notification) => notification.to.id),
|
notifications.map((notification) => notification.to.id),
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user