update notification test mode

This commit is contained in:
Ben Allfree
2024-01-10 11:39:53 +00:00
parent b7e6ead601
commit 208403faa8
2 changed files with 3 additions and 2 deletions

View File

@@ -107,12 +107,13 @@ const processNotification = (notificationRec, { log, test = false }) => {
name: $app.settings().meta.senderName,
},
to: [{ address: to }],
bcc: [{ address: `pockethost+notifications@benallfree.com` }],
subject,
html,
}
if (test) {
msgArgs.to = [{ address: `ben@benallfree.com` }]
msgArgs.bcc = [{ address: `pockethost+notifications@benallfree.com` }]
msgArgs.subject = `***TEST ${to} *** ${msgArgs.subject}`
}
log({ msgArgs })
// @ts-ignore

View File

@@ -14,7 +14,7 @@ routerAdd(`GET`, `api/process_single_notification`, (c) => {
if (!notification) {
return c.json(200, `No notifications to send`)
}
processNotification(notification, { log, test: true })
processNotification(notification, { log, test: !!c.queryParam(`test`) })
} catch (e) {
c.json(500, `${e}`)
}