Hello,
Thank you for packaging n8n. I've been playing a bit with it and tried to send an email. I'd liked it to be able to send emails like any other application.
This took a bit of fiddling, so I thought to write it up. Also, since it is not obvious how to do it, I would like this to be added to the n8n cloudron documentation so that the next user does not have to do the same research as I had to do.
When setting up the email credentials, an expression is required for each of the fields:
- User:
{{$env["CLOUDRON_MAIL_SMTP_USERNAME"]}}
- Password:
{{$env["CLOUDRON_MAIL_SMTP_PASSWORD"]}}
- Host:
{{$env["CLOUDRON_MAIL_SMTP_SERVER"]}}
- Port:
{{$env["CLOUDRON_MAIL_SMTP_PORT"]}}
- SSL/TLS: disabled
To set an expression, click the gear icon next to the field, and click Add expression
.
Then, in the expression field, paste the expression as listed before. The warning in red can be ignored, this will work fine when executing it.
Then, in a Send Email node, set the From Email field to the following expression: My App <{{$env["CLOUDRON_MAIL_FROM"]}}>
.
This will send an email with the name My App, and the address that is set in the cloudron settings.
Then, if you have set up the To and Subject, when you execute the node, you should get an email.