Email V2
Discover more about the Email V2 connector and how to use it on the Digibee Integration Platform.
The Email V2 connector enables you to send simple emails in HTML format, with or without attachments.
Parameters
Take a look at the configuration options for the connector. Parameters supported by Double Braces expressions are marked with (DB)
.
General tab
Account
Account used to authenticate with the email server. Required if the service demands authentication. Supported: Azure Key and Basic.
N/A
String
SMTP Host (DB)
SMTP server host. Example: smtp.gmail.com
smtp.gmail.com
String
SMTP Port (DB)
SMTP server port. Commonly 587, but may vary.
587
Integer
From (DB)
Sender's email address.
N/A
String
To (DB)
Recipient email address(es), separated by commas.
N/A
String
CC (DB)
CC recipient(s), separated by commas.
N/A
String
BCC (DB)
BCC recipient(s), separated by commas.
N/A
String
Subject (DB)
Email subject line.
N/A
String
Charset
Character set for the email body.
UTF-8
String
Content (DB)
Email body. Supports Freemarker templates for dynamic HTML.
N/A
String
Custom Attachments Specification
Enables raw attachment input and hides the form-based attachment field.
False
Boolean
Attachments
Email attachments. Specified via form or raw array.
N/A
Array of objects
Authenticated
Enable if SMTP authentication is required.
True
Boolean
Is Over TLS
Enable to send the message over TLS.
True
Boolean
Is Over SSL
Enable to send the message over SSL. Only available when Is Over TLS is disabled.
False
Boolean
Socket Port (DB)
Required if SSL is enabled. Specifies the port used. Only available when Is Over SSL is enabled.
N/A
Integer
Force TLSv1.2
Forces TLS 1.2 for secure email server connections. Only available when Is Over SSL is enabled.
False
Boolean
Fail On Error
If enabled, interrupts the pipeline execution when an error occurs. If disabled, execution continues, but the "success"
property will be set to false
.
False
Boolean
Documentation tab
Documentation
Optional field to describe the connector configuration and any relevant business rules.
N/A
String
Message Flow
Input
No specific input is required unless a Double Braces expression is used in any field.
Output
The connector returns a JSON object like the one below:
{
"from": "[email protected]",
"to": "[email protected],[email protected]",
"cc": "[email protected],[email protected]",
"bcc": "[email protected],[email protected]",
"subject": "Subject",
"content": "<html>Test Email!</html>",
"charset": "UTF-8",
"success": true,
"attachments": [
{
"type": "ATTACHMENT",
"attachment": "attachment.extension"
}
]
}
Field explanations:
from
: Sender emailto
: Recipientscc
: CC recipientsbcc
: BCC recipientssubject
: Email subjectcontent
: Email body (truncated if over 256 characters)charset
: Character encoding usedsuccess
: Indicates if the message was sent successfullyattachments
: List of attachments
Learn more about Messages processing in the Digibee Integration Platform.
Email V2 in action
Authentication
Email V2 supports the following authentication methods:
Basic
Use a Basic account where the username is the sender’s email and the password is the corresponding email password.
OAuth 2
Currently supported only for Microsoft-based (Outlook) email accounts.
To configure:
Set the From field with the sender's email address.
Choose an Azure Key that contains the necessary credentials.
Internally, the connector uses client-id
, client-secret
, and tenant-id
to generate a token, which is used along with the sender email to authenticate with the SMTP server.
Example: Email with attachments and inline image (RAW mode)
Configuration:
SMTP Host: smtp.gmail.com
SMTP Port: 587
From: [email protected] (the same email configured in the Account parameter)
Subject: Hello
Content:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Demystifying Email Design</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<img src="cid:myImage.png" />
</body>
</html>
Authenticated: true
Is Over TLS: true
Attachment As Raw: true
Attachments:
[
{ "type": "INLINE", "attachment": "myImage.png" },
{ "type": "ATTACHMENT", "attachment": "xpto.txt" }
]
Output:
{
"from": "[email protected]",
"to": "[email protected],[email protected]",
"cc": "",
"bcc": "",
"subject": "Hello",
"content": "<!DOCTYPE html PUBLIC ...TRUNCATED",
"charset": "UTF-8",
"success": true,
"attachments": [
{ "type": "INLINE", "attachment": "myImage.png" },
{ "type": "ATTACHMENT", "attachment": "xpto.txt" }
]
}
Dynamic email example using Double Braces expressions
You can use Double Braces expressions to insert variables dynamically into your email configuration.
In the example below, we first configured the JSON Generator (Mock) with the following data:
JSON data:
{
"sender": "[email protected]",
"recipient": "[email protected]",
"recipient_cc": "[email protected]",
"recipient_bcc": "[email protected]",
"port": "587",
"host": "smtp.gmail.com",
"INVOICE": "98787979789",
"DUE_DATE": "01/13/2023"
}
Next, we configured the Email V2 connector using Double Braces expressions to reference these values:
SMTP Host:
{{ message.host }}
SMTP Port:
{{ message.port }}
From:
{{ message.sender }}
To:
{{ message.recipient }}
CC:
{{ message.recipient_cc }}
BCC:
{{ message.recipient_bcc }}
Subject:
{{ CONCAT("Invoice ", FORMATDATE(NOW(), "timestamp", "MMMM yyyy", null, "UTC", "pt-BR", "GMT-3")) }}
Charset:
UTF-8: Eight-bit Unicode (or UCS) Transformation Format
Content:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
Good afternoon, <br/>
Below is the invoice <a href='${INVOICE}'>(Click here)</a> referring to the monthly license fee for the platform – due for <b> ${DUE_DATE}</b>. <br/>
Payment will be via <b>bank transfer</b> - given in the body of the invoice. <br/><br/>
Please, confirm the receipt. <br/>
Any questions, we are available. <br/><br/>
<br/>
<br/>
Att.,
Customer relationship
</body>
</html>
Technology
The connector uses Freemarker for dynamic content generation.
Last updated
Was this helpful?