Scenes may also send e-mails and alerts. An alert is a real time notification sent to single/multiple user/s of your organization.
The following scene send an e-mail to email@example.com
email = "firstname.lastname@example.org" subject = "Example" object = "Hey this is a test!" emailsent = resiot_sendemail(email, subject, object) -- Sleep for 1 second (1000 ms) resiot_sleep(1000) if emailsent then resiot_globaldebug("E-mail successfully sent!") else resiot_globaldebug("Error sending e-mail") end
The following scene, instead, send an alert to all users
-- If you want to send an alert only to selected user/s -- replace the first field with the desired users' e-mail -- resiot_alert("email@example.com, firstname.lastname@example.org, email@example.com", "Test Alert") notsent, err = resiot_alert("", "Test Alert") if notsent then resiot_globaldebug("Alerts successfully sent!") else resiot_globaldebug(err) end