From f2cfc2744d0d34e9f63fb13d87af898ae247c7d4 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Wed, 22 Dec 2021 14:58:15 -0600 Subject: [PATCH] fix(Slack): improve subscription notif logic --- website/server/libs/payments/subscriptions.js | 1 + website/server/libs/slack.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/website/server/libs/payments/subscriptions.js b/website/server/libs/payments/subscriptions.js index d4016349fe..1a68734680 100644 --- a/website/server/libs/payments/subscriptions.js +++ b/website/server/libs/payments/subscriptions.js @@ -293,6 +293,7 @@ async function createSubscription (data) { paymentMethod: data.paymentMethod, months: group ? 1 : months, groupId, + autoRenews, }); } diff --git a/website/server/libs/slack.js b/website/server/libs/slack.js index a88d624bfd..615c7d4284 100644 --- a/website/server/libs/slack.js +++ b/website/server/libs/slack.js @@ -182,6 +182,7 @@ function sendSubscriptionNotification ({ paymentMethod, months, groupId, + autoRenews, }) { if (SKIP_SUB_METHOD) { return; @@ -194,8 +195,10 @@ function sendSubscriptionNotification ({ text = `${buyer.name} ${buyer.id} ${buyer.email} bought a ${months}-month gift subscription for ${recipient.name} ${recipient.id} ${recipient.email}${promoString} using ${paymentMethod} on ${timestamp}`; } else if (groupId) { text = `${buyer.name} ${buyer.id} ${buyer.email} bought a 1-month recurring group-plan for ${groupId} using ${paymentMethod} on ${timestamp}`; - } else { + } else if (autoRenews) { text = `${buyer.name} ${buyer.id} ${buyer.email} bought a ${months}-month recurring subscription using ${paymentMethod} on ${timestamp}`; + } else { + text = `${buyer.name} ${buyer.id} ${buyer.email} bought a ${months}-month non-recurring subscription using ${paymentMethod} on ${timestamp}`; } subscriptionSlack