Skip to content

Commit dc25c3b

Browse files
authored
fix(backend): add transactional_email_blocked to email.suppressed reasons (#10849)
1 parent da96a61 commit dc25c3b

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎.changeset/calm-emails-block.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Add `transactional_email_blocked` to the `ClerkPolicy` reasons of the `email.suppressed` webhook event type. Clerk sends this reason when a queued transactional email is suppressed because sending was blocked for the instance.

‎packages/backend/src/__tests__/email-outcomes.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ describe('transactional email outcome webhooks', () => {
2828
type Suppressed = Extract<EmailDeliveryWebhookEvent, { type: 'email.suppressed' }>;
2929
type Policy = Extract<Suppressed['data']['suppressed'], { type: 'ClerkPolicy' }>;
3030
expectTypeOf<Policy['reason']>().toEqualTypeOf<
31-
'unverified_email_dns' | 'provider_domain_restriction' | 'application_communication_lock'
31+
| 'unverified_email_dns'
32+
| 'provider_domain_restriction'
33+
| 'application_communication_lock'
34+
| 'transactional_email_blocked'
3235
>();
3336
type Failed = Extract<EmailDeliveryWebhookEvent, { type: 'email.failed' }>;
3437
expectTypeOf<Failed['data']['failed']['reason']>().toEqualTypeOf<

‎packages/backend/src/api/resources/Webhooks.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export type EmailDeliveryWebhookEvent =
7676
| { type: 'OnProviderSuppressionList'; message: string }
7777
| {
7878
type: 'ClerkPolicy';
79-
reason: 'unverified_email_dns' | 'provider_domain_restriction' | 'application_communication_lock';
79+
reason:
80+
| 'unverified_email_dns'
81+
| 'provider_domain_restriction'
82+
| 'application_communication_lock'
83+
| 'transactional_email_blocked';
8084
message: string;
8185
};
8286
}

0 commit comments

Comments
 (0)