mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-21 05:08:51 +00:00
fix(Slack): improve subscription notif logic
This commit is contained in:
parent
e2fd6a72c2
commit
f2cfc2744d
2 changed files with 5 additions and 1 deletions
|
|
@ -293,6 +293,7 @@ async function createSubscription (data) {
|
|||
paymentMethod: data.paymentMethod,
|
||||
months: group ? 1 : months,
|
||||
groupId,
|
||||
autoRenews,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue