Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/fxa-auth-server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,6 @@ const convictConf = convict({
default: true,
env: 'SMTP_METRICS_ENABLED',
},
fxaMailerDisableSend: {
doc: 'Array of templates that should not be supported by fxa mailer. Used to fallback to previous email sending if in a pinch.',
format: Array,
default: [''],
env: 'SMTP_FXA_MAILER_DISABLE_SEND',
},
},
maxEventLoopDelay: {
doc: 'Max event-loop delay before which incoming requests are rejected',
Expand Down
38 changes: 15 additions & 23 deletions packages/fxa-auth-server/lib/inactive-accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,29 +296,21 @@ export class InactiveAccountsManager {
inactiveDeletionEta: now + emailTypeSpecificVals.timeToDeletion,
};

if (this.fxaMailer.canSend(emailTypeSpecificVals.emailTemplate)) {
await this.fxaMailer[emailTypeSpecificVals.emailSender]({
...FxaMailerFormat.account(account),
...(await FxaMailerFormat.metricsContext(requestForGlean)),
...FxaMailerFormat.localTime(requestForGlean),
...FxaMailerFormat.location(requestForGlean),
...FxaMailerFormat.device(requestForGlean),
...FxaMailerFormat.sync(false),
// use the formatter to convert inactiveDeletionEta to localized strings
deletionDate: FxaMailerFormat.localTime(
requestForGlean,
message.inactiveDeletionEta
).date,
// override acceptLanguage to ensure email is localized as best we can
acceptLanguage: account.locale,
});
} else {
await this.mailer[emailTypeSpecificVals.emailSender](
account.emails,
account,
message
);
}
await this.fxaMailer[emailTypeSpecificVals.emailSender]({
...FxaMailerFormat.account(account),
...(await FxaMailerFormat.metricsContext(requestForGlean)),
...FxaMailerFormat.localTime(requestForGlean),
...FxaMailerFormat.location(requestForGlean),
...FxaMailerFormat.device(requestForGlean),
...FxaMailerFormat.sync(false),
// use the formatter to convert inactiveDeletionEta to localized strings
deletionDate: FxaMailerFormat.localTime(
requestForGlean,
message.inactiveDeletionEta
).date,
// override acceptLanguage to ensure email is localized as best we can
acceptLanguage: account.locale,
});

this.statsd.increment(
`account.inactive.${emailTypeSpecificVals.attempt}-email.sent`
Expand Down
Loading