diff --git a/functions/src/notifications/membershipStatusNotifications.ts b/functions/src/notifications/membershipStatusNotifications.ts index 19bb5a8..bb0887b 100644 --- a/functions/src/notifications/membershipStatusNotifications.ts +++ b/functions/src/notifications/membershipStatusNotifications.ts @@ -299,7 +299,6 @@ async function sendPlanExpiredNotification( let expiryDate: Date | undefined; let formattedDate = "Unknown Date"; - let daysSinceExpiry = 0; const payments = await getPaymentsForMembership(membershipId); if (payments.length > 0) { @@ -314,9 +313,6 @@ async function sendPlanExpiredNotification( day: "numeric", }); - const now = new Date(); - const timeDiff = now.getTime() - expiryDate.getTime(); - daysSinceExpiry = Math.floor(timeDiff / (1000 * 3600 * 24)); } await app @@ -331,17 +327,12 @@ async function sendPlanExpiredNotification( 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, - daysSinceExpiry, expiryDate: expiryDate ? admin.firestore.Timestamp.fromDate(expiryDate) : admin.firestore.Timestamp.fromDate(new Date()), diff --git a/functions/src/notifications/processNotification.ts b/functions/src/notifications/processNotification.ts index d232395..37b6865 100644 --- a/functions/src/notifications/processNotification.ts +++ b/functions/src/notifications/processNotification.ts @@ -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":