Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Documentation request: sending email from n8n

Scheduled Pinned Locked Moved N8N
6 Posts 4 Posters 296 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jk
    wrote on last edited by jk
    #1

    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.

    cloudron_n8n_screenshot_1.png

    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.

    cloudron_n8n_screenshot_2.png

    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.

    cloudron_n8n_screenshot_3.png

    Then, if you have set up the To and Subject, when you execute the node, you should get an email.

    cloudron_n8n_screenshot_4.png

    T BrutalBirdieB 2 Replies Last reply
    4
  • T Offline
    T Offline
    thetomester13 App Dev
    replied to jk on last edited by
    #2

    @jk this is great! I've had n8n configured to send emails, but I actually manually created a new user that has email access and put in the credentials myself. Very helpful!

    J 1 Reply Last reply
    1
  • J Offline
    J Offline
    jk
    replied to thetomester13 on last edited by
    #3

    @thetomester13 Thanks 😄 I'm glad I've been of help!

    1 Reply Last reply
    1
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to jk on last edited by
    #4

    @jk maybe there is also a way to auto configure this, so no doc is needed.
    I will have a look at it tomorrow.

    Like my work? Consider donating a drink drink. Cheers!

    1 Reply Last reply
    2
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by girish
    #5

    Ah good docs. But I think the correct approach to this is to do what @thetomester13 suggested which is to create a mailbox and use those credentials. Ideally, generate "email" password credentials and put it into the app i.e via the Profile view in the App Password section. Generally, the "automated" email setup is really for apps to send notifications, password reset etc.

    In fact, I think it's a mistake to have sendmail addon in the app package. We should probably remove it. What do you guys think?

    1 Reply Last reply
    2
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #6

    OK, just as a heads up, the next package will remove the sendmail addon to avoid this confusion. This for writing this post @jk ! I didn't know you can access things using {{$env[xx]}}

    1 Reply Last reply
    2

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.