From 208403faa8bb6bd100f59e70531e2ea9cfdd3910 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Wed, 10 Jan 2024 11:39:53 +0000 Subject: [PATCH] update notification test mode --- src/mothership-app/pb_hooks/src/lib.js | 3 ++- src/mothership-app/pb_hooks/src/notifications.pb.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mothership-app/pb_hooks/src/lib.js b/src/mothership-app/pb_hooks/src/lib.js index a67f3309..0e127c2f 100644 --- a/src/mothership-app/pb_hooks/src/lib.js +++ b/src/mothership-app/pb_hooks/src/lib.js @@ -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 diff --git a/src/mothership-app/pb_hooks/src/notifications.pb.js b/src/mothership-app/pb_hooks/src/notifications.pb.js index a1b72b7b..e9ab43ef 100644 --- a/src/mothership-app/pb_hooks/src/notifications.pb.js +++ b/src/mothership-app/pb_hooks/src/notifications.pb.js @@ -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}`) }