ashok 10 months ago
commit ad65aedaa7

@ -2281,29 +2281,29 @@ eventEmitter.on(
}
);
eventEmitter.on('sendLowWaterNotification', (fcmTokens, message) => {
const notificationMessage = `Warning: Water level is low in the tank.
Tank Name: ${tankName},
Location: ${receiverTank.location},
Type of Water: ${receiverTank.typeOfWater},
Current Water Level: ${currentWaterLevel} liters (${currentWaterPercentage.toFixed(2)}%),
Date & Time: ${new Date().toLocaleString()}`;
// Send notifications using the provided FCM tokens
sendNotification(fcmTokens, notificationMessage);
});
// eventEmitter.on('sendLowWaterNotification', (fcmTokens, message) => {
// const notificationMessage = `Warning: Water level is low in the tank.
// Tank Name: ${tankName},
// Location: ${receiverTank.location},
// Type of Water: ${receiverTank.typeOfWater},
// Current Water Level: ${currentWaterLevel} liters (${currentWaterPercentage.toFixed(2)}%),
// Date & Time: ${new Date().toLocaleString()}`;
// // Send notifications using the provided FCM tokens
// sendNotification(fcmTokens, notificationMessage);
// });
eventEmitter.on('sendCriticalLowWaterNotification', (fcmTokens, message) => {
const notificationMessage = `Critical Alert: Water level is critically low in the tank.
Tank Name: ${tankName},
Location: ${receiverTank.location},
Type of Water: ${receiverTank.typeOfWater},
Current Water Level: ${currentWaterLevel} liters (${currentWaterPercentage.toFixed(2)}%),
Date & Time: ${new Date().toLocaleString()}`;
// eventEmitter.on('sendCriticalLowWaterNotification', (fcmTokens, message) => {
// const notificationMessage = `Critical Alert: Water level is critically low in the tank.
// Tank Name: ${tankName},
// Location: ${receiverTank.location},
// Type of Water: ${receiverTank.typeOfWater},
// Current Water Level: ${currentWaterLevel} liters (${currentWaterPercentage.toFixed(2)}%),
// Date & Time: ${new Date().toLocaleString()}`;
// Send notifications using the provided FCM tokens
sendNotification(fcmTokens, notificationMessage);
});
// // Send notifications using the provided FCM tokens
// sendNotification(fcmTokens, notificationMessage);
// });

Loading…
Cancel
Save