Hopefully a simple question: I cannot see the Mail action available to install. I want to send SMS text notifications and had this working successfully in the past before my openhab reload. Did this Action go away in the 2.5 build?
Sometime around 2.5 M2 a Mail binding was released which replaced the Mail Action. This the Mail Action went to Legacy. You can see it if you turn on “show Legacy 1.x bindings” in PaperUI and it will show up again. Or, better, you can find the new Mail binding under bindings.
Thanks, Rich. I’d seen the Mail binding and reviewed it, but it looks like it only does email; is there a current method to “text” as the old action did? I just found it more effective, I pay more attention to texts than I do to email.
I went back and looked at my rules, and should mention that I was actually using the ability of AT&T to convert an email to a text for me ("xxxxxxxxxx@txt.att.net"). So I guess all I need is the Mail binding…
But I’m getting the error in the logs
Error during the execution of rule 'Test': The name 'sendMail' cannot be resolved to an item or type; line 116, column 4, length 53
which would indicate (normally) that the binding is not installed.
Thanks, all. I did begin reviewing the binding information after my posting and began some attempts to replicate it. I’m still struggling a bit, this is what I have:
import java.util.List
//
// TEST MAIL RULE
rule "Mail Test"
when
Time cron "0 09 20 ? * * *"
then
val mailActions = getActions("mail","mail:smtp:att_smtp")
mailActions.sendMail ("xxxxxxxxx@txt.att.net", "SAFETY", "TesT")
sendBroadcastNotification("TesT")
//actions.get("mail", "mail:smtp:att_smtp").sendMail("xxxxxxxxx@txt.att.net", "SAFETY", "Test")
end
where the “xxx…x” is my cell phone number. You can see I was trying a few alternatives. The “import.” statement is at the top of my rules.
I’m not seeing a thing listed in PaperUI although there had been one there before.
My messaging rule is:
rule "Mail Test"
when
Time cron "0 13 20 ? * * *"
then
val mailActions = getActions("mail","mail:smtp:testmail")
mailActions.sendMail("myaccount@gmail.com", "This is the content")
end
I’m getting the following error in the logs when the rule executes:
2019-10-26 20:13:00.091 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Mail Test': An error occurred during the script execution: index=3, size=3
Update, here is where I am:
The rule seems to be executing correctly; no more errors there (my mailActions line was not formatted correctly, I was missing the “title” entry). It’s now:
mailActions.sendMail("myaccount@gmail.com", "Test subject", "This is the mail content.")