Skip to content

Commit aa2e1a4

Browse files
committed
fix(auth-service): log all email delivery paths
The first pass updated only the client-branded delivery log and overlooked the three other sendMail call sites. That left standard sign-in, welcome, and backup verification deliveries without the same structured recipient context.\n\nAdd an email field to the delivery log for every sendMail path while retaining Nodemailer's required to envelope property.\n\nCo-authored-by: OpenAI Codex <codex@openai.com>
1 parent ce25beb commit aa2e1a4

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.changeset/email-log-recipient-field.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Email delivery logs use a consistent recipient field.
66

77
**Affects:** Operators
88

9-
**Operators:** Update structured-log queries for `Sent client-branded OTP email` to read the recipient from `email` instead of `to`.
9+
**Operators:** All four email delivery paths now log the recipient as `email`: client-branded OTP, standard sign-in OTP, welcome OTP, and backup-email verification. Update structured-log queries for `Sent client-branded OTP email` to read `email` instead of `to`.

packages/auth-service/src/email/sender.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export class EmailSender {
165165
text,
166166
html,
167167
})
168+
logger.info({ email: to }, 'Sent sign-in OTP email')
168169
}
169170

170171
private async sendWelcomeCode(opts: {
@@ -183,6 +184,7 @@ export class EmailSender {
183184
text,
184185
html,
185186
})
187+
logger.info({ email: to }, 'Sent welcome OTP email')
186188
}
187189

188190
async sendBackupEmailVerification(opts: {
@@ -201,5 +203,6 @@ export class EmailSender {
201203
text,
202204
html,
203205
})
206+
logger.info({ email: to }, 'Sent backup email verification')
204207
}
205208
}

0 commit comments

Comments
 (0)