OnTrue
// Put your trigger code logic here.
// To execute the Code To Run,
// use a 'return true' or 'return false' otherwise.
Program.AddInputField("Email.Recipients", "", "Comma separated list of recipients e-mails that will get a test e-mail");
Program.AddInputField("Email.Message", "Just a HomeGenie Test", "E-mail message");
// add a push button widget - push it once and the e-mail is sent
Program.UseWidget("homegenie/generic/program");
// this program will NOT be running in background
return false;
// CSharp Automation Program Plugin
// when the switch ON is pressed, a test e-mail is sent
var subject = "HomeGenie Test E-Mail";
var recipients = Program.InputField("Email.Recipients").Value;
var messageText = Program.InputField("Email.Message").Value;
if ((recipients != "") && (messageText != ""))
{
Program.RunAsyncTask(() => {
if (Net.SendMessage(recipients, subject, messageText) == true)
Program.Notify("E-Mail Test", "SUCCESS! Test E-Mail sent.");
else Program.Notify("E-Mail Test", "ERROR: Test E-Mail **NOT** sent.");
});
}
else
Program.Notify("E-Mail Test", "ERROR: Missing input field(s) - recipients and/or message text.");
HomeAutomation.HomeGenie.Automation
1016
Send Test E-Mail
Sends to a test e-mail to a user defined account with a user defined message using the HG e-mail account.
Contrib
2015-08-24T02:40:26.574484Z
2015-08-24T02:53:33.252872Z
CSharp
true