Skip to content

Commit 78d9769

Browse files
authored
Merge pull request #197 from hypercerts-org/fix/email-log-field
fix(auth-service): log email recipients consistently
2 parents fa5105a + aa2e1a4 commit 78d9769

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'ePDS': minor
3+
---
4+
5+
Email delivery logs use a consistent recipient field.
6+
7+
**Affects:** Operators
8+
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class EmailSender {
133133
html: branded.html,
134134
})
135135
logger.info(
136-
{ to, clientId: opts.clientId },
136+
{ email: to, clientId: opts.clientId },
137137
'Sent client-branded OTP email',
138138
)
139139
return
@@ -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)