Skip to content

Commit 34fab17

Browse files
authored
Merge pull request #19871 from mozilla/pay-3431-email-strapi-links
fix(auth): use strapi links for non-webhook emails
2 parents af25995 + 3cb4cab commit 34fab17

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/fxa-auth-server/lib/senders/email.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,7 @@ module.exports = function (log, config, bounces, statsd) {
28002800
};
28012801

28022802
Mailer.prototype.subscriptionPaymentExpiredEmail = async function (message) {
2803-
const { email, uid, planId, acceptLanguage, subscriptions } = message;
2803+
const { email, uid, acceptLanguage, subscriptions } = message;
28042804

28052805
const enabled = config.subscriptions.transactionalEmails.enabled;
28062806
log.trace('mailer.subscriptionPaymentExpired', {
@@ -2835,7 +2835,7 @@ module.exports = function (log, config, bounces, statsd) {
28352835
}
28362836

28372837
const cmsLinks = await this._generateCmsLinks(
2838-
planId,
2838+
subscriptions[0]?.planId,
28392839
acceptLanguage,
28402840
template
28412841
);
@@ -2859,7 +2859,7 @@ module.exports = function (log, config, bounces, statsd) {
28592859
Mailer.prototype.subscriptionPaymentProviderCancelledEmail = async function (
28602860
message
28612861
) {
2862-
const { email, uid, planId, acceptLanguage, subscriptions } = message;
2862+
const { email, uid, acceptLanguage, subscriptions } = message;
28632863

28642864
const enabled = config.subscriptions.transactionalEmails.enabled;
28652865
log.trace('mailer.subscriptionPaymentProviderCancelled', {
@@ -2894,7 +2894,7 @@ module.exports = function (log, config, bounces, statsd) {
28942894
}
28952895

28962896
const cmsLinks = await this._generateCmsLinks(
2897-
planId,
2897+
subscriptions[0]?.planId,
28982898
acceptLanguage,
28992899
template
29002900
);
@@ -3219,7 +3219,7 @@ module.exports = function (log, config, bounces, statsd) {
32193219
};
32203220

32213221
Mailer.prototype.subscriptionEndingReminderEmail = async function (message) {
3222-
const { email, uid, planId, acceptLanguage, subscription } = message;
3222+
const { email, uid, acceptLanguage, subscription } = message;
32233223

32243224
const enabled = config.subscriptions.transactionalEmails.enabled;
32253225
log.trace('mailer.subscriptionEndingReminderEmail', {
@@ -3245,7 +3245,7 @@ module.exports = function (log, config, bounces, statsd) {
32453245
template
32463246
);
32473247
const cmsLinks = await this._generateCmsLinks(
3248-
planId,
3248+
subscription.planId,
32493249
acceptLanguage,
32503250
template
32513251
);
@@ -3298,7 +3298,7 @@ module.exports = function (log, config, bounces, statsd) {
32983298
};
32993299

33003300
Mailer.prototype.subscriptionRenewalReminderEmail = async function (message) {
3301-
const { email, uid, planId, acceptLanguage, subscription } = message;
3301+
const { email, uid, acceptLanguage, subscription } = message;
33023302

33033303
const enabled = config.subscriptions.transactionalEmails.enabled;
33043304
log.trace('mailer.subscriptionRenewalReminderEmail', {
@@ -3324,7 +3324,7 @@ module.exports = function (log, config, bounces, statsd) {
33243324
template
33253325
);
33263326
const cmsLinks = await this._generateCmsLinks(
3327-
planId,
3327+
subscription.planId,
33283328
acceptLanguage,
33293329
template
33303330
);

packages/fxa-auth-server/test/local/senders/emails.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ const MESSAGE = {
140140
productId: 'wibble',
141141
},
142142
subscriptions: [
143-
{ productName: 'Firefox Fortress' },
144-
{ productName: 'Cooking with Foxkeh' },
143+
{ planId: 'plan-example', productName: 'Firefox Fortress' },
144+
{ planId: 'other-plan', productName: 'Cooking with Foxkeh' },
145145
],
146146
showPaymentMethod: true,
147147
discountType: 'forever',

0 commit comments

Comments
 (0)