Skip to content

Routes: Email

TekMonks edited this page May 20, 2021 · 1 revision

The Email SMTP Client Route

The Email route node is used to send emails.

This node will parse the parse the incoming response data and send the appropriate email.

Required fields can be picked up from the JSON message or from node properties themselves. For example, the email address to send the email to can be picked up from either message.content.to or from the to property of the node declaration inside the flow.

The code block below documents the format for the Email route node.

"route1":{
    "type": "email",
    "dependencies":"route0",
    "host":"smtp.mailgun.org",
    "port": 465,
    "secure": true,
    "user": "[email protected]",
    "password": "<encrypted password goes here>",
    "to": "[email protected]",
    "from": "[email protected]",
    "title": "New request was submitted",
    "text": "New file has been submitted for processing.",
    "html": "<p>New file has been submitted for processing.</p>"
}

The host property is used to point to the SMTP host.

The port is used to indicate the SMTP port.

secure is true if the SMTP host is using SSL.

user is the login ID for the SMTP server.

password is the encrypted password for the SMTP server. The encryption can be done using this command node [asb]/lib/crypt.js encrypt [text to encrypt]

to, from, title, text, and html are the person to send the email to, from, subject of the email and the content of the email as text and HTML respectively. These properties can be picked from the message content or from the flow declaration.

attachments property can be used to add attachments. It can be a path to the file to be attached, or a data URI e.g. data:text/plain;base64,aGVsbG8gd29ybGQ=