From 9be411ceed349c7bb5de4a90278fa2e354609ea0 Mon Sep 17 00:00:00 2001 From: Henri Remonen Date: Wed, 18 Oct 2023 11:08:51 +0300 Subject: [PATCH] feat: add logging to sent emails --- src/server/mailer/pate.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/mailer/pate.ts b/src/server/mailer/pate.ts index 32bd7d7b..e0573cce 100644 --- a/src/server/mailer/pate.ts +++ b/src/server/mailer/pate.ts @@ -1,5 +1,7 @@ import axios from 'axios' +import logger from '../util/logger' + import { PATE_URL } from '../util/config' import { inProduction, inStaging } from '../../config' @@ -31,6 +33,12 @@ const sendEmail = async (targets: string[], text: string, subject: string) => { settings, } + logger.info(`Sending emails to ${targets.length} recipients`, { + recipients: targets, + subject, + text, + }) + await pateClient.post('/', mail) }