Haiku Haiku Helper email alerting

arakasi55

Member
Hi, i've managed to setup email alerting from HH, however i'd really like to be able to include which zone has been tripped in the email.
Unfortunately, i'm no java programmer so despite playing around, i've not been able to work it out. Has anyone got this working that would be willing to share the code?

I did find this in another post, which helped me to get the email side working, but I'm not sure on how to actually implement it into the notification.
If i'm correct in my guess, the below code loops the zones and if it's been tripped, it add's it to a variable called report. I guess that I would then need to display the output of the report variable in the email notification?

Code:
var report = "\nZones Not Ready:\n\n";

var zones = controller.zones;
for(i in zones) {
    var zone = zones[i];
    if(zone.isNotReady) report += zone.bestDescription + "\n";
}

Thanks in advance :-)
 
You're on the right track with the loop code. Just add + report to your mail call's body argument. If you need more help, please paste your script.
 
Back
Top