Skip to content

Commit 546f175

Browse files
committed
task(auth): Handle second and final account delete notifications
Because: - We want to send out a second notification about account deletion - We want to send out a final notification about account deletion This PR: - Adds support to send out second in active account warning email - Adds support to send out final in active account warning email - Refactors InactiveAccountManager.handleFirstNotificationTask so that it can be parameterized and reused. - Adds required glean events - Adds required metrics
1 parent f270419 commit 546f175

13 files changed

Lines changed: 1182 additions & 84 deletions

File tree

libs/shared/cloud-tasks/src/lib/send-email-tasks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { CloudTaskOptions } from './cloud-tasks.types';
1515
export enum EmailTypes {
1616
INACTIVE_DELETE_FIRST_NOTIFICATION = 'inactiveDeleteFirstNotification',
1717
INACTIVE_DELETE_SECOND_NOTIFICATION = 'inactiveDeleteSecondNotification',
18+
INACTIVE_DELETE_FINAL_NOTIFICATION = 'inactiveDeleteFinalNotification',
1819
}
1920
export type CloudTaskEmailType = (typeof EmailTypes)[keyof typeof EmailTypes];
2021

packages/fxa-auth-server/lib/email-cloud-tasks.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,20 @@ export class EmailCloudTaskManager {
123123
// @TODO FXA-10574, FXA-10942
124124
switch ((request.payload as SendEmailTaskPayload).emailType) {
125125
case EmailTypes.INACTIVE_DELETE_FIRST_NOTIFICATION:
126-
await this.inactiveAccountsManager.handleFirstNotificationTask(
126+
await this.inactiveAccountsManager.handleNotificationTask(
127+
'first',
128+
request.payload as SendEmailTaskPayload
129+
);
130+
break;
131+
case EmailTypes.INACTIVE_DELETE_SECOND_NOTIFICATION:
132+
await this.inactiveAccountsManager.handleNotificationTask(
133+
'second',
134+
request.payload as SendEmailTaskPayload
135+
);
136+
break;
137+
case EmailTypes.INACTIVE_DELETE_FINAL_NOTIFICATION:
138+
await this.inactiveAccountsManager.handleNotificationTask(
139+
'final',
127140
request.payload as SendEmailTaskPayload
128141
);
129142
break;

0 commit comments

Comments
 (0)