ashok 10 months ago
commit ad65aedaa7

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

Loading…
Cancel
Save