Both 'renderedValue' and 'rendered' return 'undefined' in email unfortunately.
Would you be able to help with the script please?
Both 'renderedValue' and 'rendered' return 'undefined' in email unfortunately.
Would you be able to help with the script please?
thanks Matt.
more context...
We've got event handlers, and they are working fine.
But now we need to enhance the emails to show a bit more data at the time of the event, thus populate some data points values into the email e.g.
State (multistate type data point with 15 rendered values e.g. 1=Ready, 2=Fault etc) or
Alarm (binary type, 0=Inactive, 1=Active).
I'm defining these data points in Event Handler Script:
model.put("p1",p1.value)
model.put("p2",p2.value)
and adding code into Custom Email Template:
<table>
<tr>
<th>State</th>
<td>${p1}</td>
</tr>
<tr>
<th>Alarm</th>
<td>${p2}</td>
</tr>
</table>
result as per initial post:
when only multistate data point defined in the code above, I'm getting an email and it contains State value as '1', not as I would expect - 'Ready'
and when binary data point is in the code - email is not getting send
MangoGT 3.7.7
How to make an Event Handler to email rendered multistate values and binary points please?
At the moment multistate data point returns raw value and binary blocks emails from sending altogether (errors in .ma file).
.ma file :
ERROR 2021-05-04T09:27:34,289 (com.serotonin.m2m2.rt.event.handlers.EmailHandlerRT.sendEmail:468) - Error sending email
java.lang.NullPointerException: null
at com.serotonin.m2m2.rt.event.handlers.EmailHandlerRT.sendEmail(EmailHandlerRT.java:292) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.rt.event.handlers.EmailHandlerRT.sendEmail(EmailHandlerRT.java:208) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.rt.event.handlers.EmailHandlerRT.scheduleTimeout(EmailHandlerRT.java:165) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.rt.event.handlers.EmailHandlerRT.scheduleTimeout(EmailHandlerRT.java:79) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.util.timeout.ModelTimeoutTask.run(ModelTimeoutTask.java:36) ~[mango-3.7.7.jar:?]
at com.serotonin.timer.Task.runTask(Task.java:179) ~[mango-3.7.7.jar:?]
at com.serotonin.timer.TaskWrapper.run(TaskWrapper.java:23) ~[mango-3.7.7.jar:?]
at com.serotonin.timer.OrderedThreadPoolExecutor$OrderedTaskCollection.run(OrderedThreadPoolExecutor.java:314) ~[mango-3.7.7.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at java.lang.Thread.run(Thread.java:830) [?:?]
Still not solved.
The problem is - I've got legacy users which have been deleted from the mango server when people left the company.
I'm unable to add them back (error says username already exist) and I can't see them in JSON export for Users.
this issue is still valid in Mango version 3.7,
have to use old UI to add emails.
Thanks Matt.
This didn't work for me. I've set the value to 5 minutes and after 15+ minutes everyone was still showing as Active in Events and I was able to navigate around without logging in again.
Hello,
We've got a situation when people are logging into the Mango and leaving their sessions running for a while, which is increasing internet traffic.
Is there a way to gracefully log out someone without restarting the Mango please?
Appreciate your help.
Elena