Compare commits
8 Commits
main
...
expiry-usi
| Author | SHA1 | Date | |
|---|---|---|---|
| 81964946f8 | |||
| a2ce504b02 | |||
| 3c405012b9 | |||
| c2be01e6b1 | |||
| 3a4c5cab2a | |||
| a22d8f9ea6 | |||
| 690732d515 | |||
| b2bb8891c3 |
@ -274,6 +274,7 @@ async function processExpiredMembership(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function sendPlanExpiredNotification(
|
||||
membershipId: string,
|
||||
membershipData: MembershipData
|
||||
@ -311,6 +312,7 @@ async function sendPlanExpiredNotification(
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
await app
|
||||
@ -323,15 +325,13 @@ async function sendPlanExpiredNotification(
|
||||
notificationSent: false,
|
||||
timestamp: admin.firestore.FieldValue.serverTimestamp(),
|
||||
read: false,
|
||||
readBy: [],
|
||||
data: {
|
||||
title: "Plan Expired",
|
||||
message: `The plan ${
|
||||
membershipData.subscription?.name || "Unknown Plan"
|
||||
} for client ${clientName} has expired.`,
|
||||
planName: membershipData.subscription?.name || "Unknown Plan",
|
||||
clientName,
|
||||
membershipId,
|
||||
gymName,
|
||||
ownerId: gymOwnerId,
|
||||
formattedExpiryDate: formattedDate,
|
||||
expiryDate: expiryDate
|
||||
? admin.firestore.Timestamp.fromDate(expiryDate)
|
||||
|
||||
@ -240,7 +240,7 @@ function prepareNotificationMessage(
|
||||
title = notification.data?.title || "Plan Expired";
|
||||
body =
|
||||
notification.data?.message ||
|
||||
`The plan ${notification.data?.planName} for client ${notification.data?.clientName} has expired.`;
|
||||
`${notification.data?.clientName}/s subscription for plan ${notification.data?.planName} has expired.`;
|
||||
break;
|
||||
|
||||
case "schedule_update":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user