Email Notifications
Last updated
Last updated
Email allows you to send custom emails directly from your apps logic.
You can either use the internal email server, sending emails from no-reply@heisenware.com
, or connect your own SMTP server to send emails using a custom sender address.
Use the send
function to send an email from the internal email server. It will use the no-reply@heisenware.com
as sender address.
The send
function allows you to define the recipients address, subject, content and attachments. All inputs except the address can be filled dynamically. The send function can be triggered by any event or action.
Both, subject and content, expect a string and don't require any further inputs but the actual string.
By using an array in the attachment box you can attach more than one file to an email.
In the example below, the subject, content and attachments are dynamically filled from a form and a file uploader, while the recipients address is predefined. A button triggers the send function.
This is how the email looks like:
To send emails from a custom email address, you need to connect to an SMTP server. Use the create
function to establish this connection.
After entering all required information, trigger the create
function to create the emailer.
Hover above the arrow icon of each input box to understand what to fill into the boxes.
Enter a unique name for the emailer into the first, yellow box.
Enter the connection data for your SMTP server.
Authentication with the SMTP server can be done with username and password or OAuth 2.0.
Username and password
OAuth 2.0
With defaults, you can define defaults for each email send with the emailer. For example, a default sender address can be defined. The defaults box expects data as object.
After your SMTP server is connected, you can use the send function of this server accordingly. It will appear right below the internal email.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
from:
string
The email address of the sender. Can be plan email address or formatted as Sender Name sender@server.com
.
to:
string
Comma-separated list or an array of recipients email addresses.
cc:
string
Comma-separated list or an array of recipients email addresses to be CC'd.
bcc:
string
Comma-separated list or an array of recipients email addresses to be BCC'd.
filename:
string
Name of the attached file using Unicode.
content:
string, buffer or stream
The actual attachment as string, buffer or stream.
path:
string
Path of the file if you are using stream as content.
href:
string
URL of the file as alternative to path.
httpHeaders:
string
Optional HTTP headers to pass on with the href request, e.g., {authorization "bearer ..."}
.
cid:
string
Optional content ID for using inline images in HTML message source.
host:
string
Hostname or IP address to connect to.
port:
integer
The port to connection to. Defaults to 587 if secure
is false and to 465 if true.
secure:
boolean
If true
, the connection will use TLS when connecting to the server. If false
then TLS is used if the server supports the STARTTLS extension. Defaults to false
.
ignoreTLS:
boolean
Set to true
to disable TLS even if secure
is false
and the server supports STARTTLS extension.
requireTLS:
boolean
Set to true
to try starting STARTTLS via Nodemailer. If the connection can't be encrypted, the message won't be sent.
user:
string
The username. Typically, the users email address.
pass:
string
The password for the user.
type:
string
Defaults to login
. Set to oauth2
to activate OAuth2.0 authentication.
_faClientId:
string
The registered client ID of the application.
_faClientSecret:
string
The registered client secret of the application.
refreshToken:
string
An optional refresh token. If provided, Nodemailer tries to generate a new access token if the existing one expires or fails.
accessToken:
string
The access token for the user. Only required if no refreshToken
is available and there is no token refresh callback specified.
expires:
string
An optional expiration time for the current accessToken
.
accessUrl:
string
An optional HTTP endpoint for requesting new access tokens. Defaults to Gmail.
serviceClient:
string
The required service client ID. To be found in the field client_id in the service key file.
privateKey:
string
The required private key. To be found in the file private_key in the service key file.