Set up emails in when-then rules

Good evening
I’m trying to set some rules with email notifications
Just for testing purpose, my rule is “When Time - next minute” send an email with default message
I configured SMTP in keycloak but I’m not sure if that’s the right place and can’t find documentation about emails. Test connection works, but the rule gives the following error

Error processing from REALM_RULESET - NOTIFICATION_HANDLER_CONFIG_ERROR (Handler is not valid: email): Notification{name=‘null’, message=org.openremote.model.notification.EmailNotificationMessage@18c5bd5d, repeatFrequency=null, repeatInterval=‘null’, targets=[Target{type=CUSTOM, id=#########@#######}]}

I tried few combinations but always returns the same error. Am I missing something in the configuration?
Many thanks!

Hi pcr,

You can set the email host/user/password/from address in the manager environment variables of the docker file. See openremote/docker-compose.yml at 83a4d9ddde8f52220c1929846e3bbd0b2bf7865d · openremote/openremote · GitHub

Don

1 Like

Hi Don
thank you very much for your answer
Is this the only way? I don’t really like to write passwords in plain-text in the config file, even if it’s a app-specific password

Also is there any example of configuration? I tried to set everything in the .yml but it says “expected : at line 70 and 71”. I don’t also know how to set SSL/STARTTLS ports

The deploy.yml docker compose file acts as the reference for environment variables and you can see the environment variables relating to email config.

As for how to supply environment variables that is a deployment issue that you can address in many ways; we use github actions for deployment and we therefore use github secrets to store sensitive information.

You can also use env files with docker and then you could encrypt them using the gradle plugin we already have in the code base:

2 Likes

Works correctly, thank you so much!
I’ll think about how to encrypt passwords now, thanks for the advice