This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Send a Email when a New alert occurs
#3
(28.12.2021, 08:33)admin Wrote: You can create a custom function and place it into Common functions. Then this function can be used in all script.
Code:
function mailalert(subject, message)
  mail({ ... }, subject, message)
  alert(message)
end



Thanks, now I get emails Smile
It's just the alerted function stoped working, what am I missing? 

temperature = event.getvalue()
setpoint = 68
alerted = storage.get('alerted')
if temperature >= setpoint then
  if not alerted then
      mailalert('Vestis Gerby', 'Kayttovesi Lahto Lampotila Korkea Ouman ' .. temperature)
    storage.set('alerted', true)
  end
else
  storage.set('alerted', false)
end
Reply


Messages In This Thread
RE: Send a Email when a New alert occurs - by Jonas S - 29.12.2021, 05:50

Forum Jump: