Skip to content

Commit

Permalink
feat: add logging to sent emails
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Oct 18, 2023
1 parent d5e540e commit 9be411c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server/mailer/pate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import axios from 'axios'

import logger from '../util/logger'

import { PATE_URL } from '../util/config'
import { inProduction, inStaging } from '../../config'

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 9be411c

Please sign in to comment.