I’m Using the Mail-Action and the Rule-Engine.
Wenn i setup a new rule
When…[something]
Then…(execute a given script)
script: sendMail(“aaa@bbb.cc”, “subjecttext”, “messagetext”)
When i run this rule i get this error in the log
[ERROR] [internal.handler.ScriptActionHandler] - Script execution failed: ReferenceError: “sendMail” is not defined in at line number 1
What is the correct syntax in the rule-engine for sending an email with the mail-action
The same happens when i’m using the action BroadcastNotification
sendBroadcastNotification(“text notification”)
Script execution failed: ReferenceError: “sendBroadcastNotification” is not defined in at line number 1
# The SMTP server hostname, e.g. "smtp.gmail.com"
hostname=smtp.abcde.com
# the SMTP port to use (optional, defaults to 25 (resp. 587 for TLS/SSL))
port=yxz
# the username and password if the SMTP server requires authentication
username=your_username
password=your_password
# The email address to use for sending mails
from=your_email
# set to "true", if STARTTLS is enabled (not required) for the connection
# (optional, defaults to false)
tls=true
# set to "true", if SSL negotiation should occur on connection
# do not use both tls=true and ssl=true
# (optional, defaults to false)
ssl=false
# set to "true", if POP before SMTP (another authentication mechanism)
# should be enabled. Username and Password are taken from the above
# configuration (optional, default to false)
popbeforesmtp=false
# Character set used to encode message body
# (optional, if not provided platform default is used)
#charset=
and thats the Errror Message
[ERROR] [internal.handler.ScriptActionHandler] - Script execution failed: ReferenceError: “sendMail” is not defined in at line number 1
I to get the same error. Mail.cfg is correctly set for Gmail and I’m doing a time based rule in the rule engine.
I’m not sure if the rule engine is working correctly. I have not tried creating a rules file and doing it that way.
I stopped playing around with that and just created $$.rules file and it’s working fine. Rules don’t show in UI but doesn’t matter to me. Try that as a test and see if your email starts
I am still a noob playing around with this, but got it to work. It won’t show up in the UI, but don’t care for it much, so far pleased with the notifications.