Action summary
Brevo -> Send Email
Function Documentation: Brevo → Send Single Email
Overview
This function sends a single email using the Brevo (Sendinblue) API with HTML content. It requires inputs such as the API key, sender and receiver details, email content, and subject. The function validates and processes the input before making a request to the Brevo API.
Inputs
brevo_api_key (registry/text) Required
- Description: API key for authenticating with Brevo API.
- Example:
xkeysib-...
from (object) Required
- Description: The sender's email address.
- Example:
sender@example.com
to (object) Required
- Description: The recipient's email address.
- Example:
receiver@example.com
message_html (text) Required
- Description: The HTML content to be sent.
- Example:
<html><body><h1>Hello</h1></body></html>
subject (text) Required
- Description: The subject of the email.
- Example:
Welcome to our service!
Function Stack
1. Try / Catch Block
1. Precondition: Check Valid HTML Content
- Description: Ensures the HTML content for the email is valid before proceeding.
2. API Request to Sendinblue
- API Request to
https://api.brevo.com/v3/smtp/email
- Purpose: Sends the email using the Brevo (Sendinblue) API.
- Return Value: The API response is stored as
api_response
.
3. Create Variable: response
- Variable:
var: response = var: api_response.response.result
- Purpose: Stores the API response for the SMS send operation.
2 Error Handling (Catch)
- Create Variable:
response
- Purpose: If the API call fails or returns an error, this block catches the error and provides an error message.
Response
The function returns the result of the email send operation, including status and any relevant messages.
Success Response
{
"messageId": "<202410100***.1236169****@smtp-relay.mailin.fr>",
}
Error response
{
"message": "Key not found",
"code": "unauthorized"
}
Example
Input
{
"from":{
"from_name":"John",
"from_email":"sohansakhare****@gmail.com"
},
"to":{
"to_name":"David",
"to_email":"sajankumar.****@unicoco****.com"
},
"email_html":"<html><head></head><body><p>Hello world</p></body></html>",
"subject":"abc"
}
Output
{
"messageId": "<202410100***.1236169****@smtp-relay.mailin.fr>"
}
Version notes
2024-10-11 21:40:55
Function Documentation: Brevo → Send Single Email
Overview
This function sends a single email using the Brevo (Sendinblue) API with HTML content. It requires inputs such as the API key, sender and receiver details, email content, and subject. The function validates and processes the input before making a request to the Brevo API.
Inputs
brevo_api_key (registry/text) Required
- Description: API key for authenticating with Brevo API.
- Example:
xkeysib-...
from (object) Required
- Description: The sender's email address.
- Example:
sender@example.com
to (object) Required
- Description: The recipient's email address.
- Example:
receiver@example.com
message_html (text) Required
- Description: The HTML content to be sent.
- Example:
<html><body><h1>Hello</h1></body></html>
subject (text) Required
- Description: The subject of the email.
- Example:
Welcome to our service!
Function Stack
1. Try / Catch Block
1. Precondition: Check Valid HTML Content
- Description: Ensures the HTML content for the email is valid before proceeding.
2. API Request to Sendinblue
- API Request to
https://api.brevo.com/v3/smtp/email
- Purpose: Sends the email using the Brevo (Sendinblue) API.
- Return Value: The API response is stored as
api_response
.
3. Create Variable: response
- Variable:
var: response = var: api_response.response.result
- Purpose: Stores the API response for the SMS send operation.
2 Error Handling (Catch)
- Create Variable:
response
- Purpose: If the API call fails or returns an error, this block catches the error and provides an error message.
Response
The function returns the result of the email send operation, including status and any relevant messages.
Success Response
{
"messageId": "<202410100***.1236169****@smtp-relay.mailin.fr>",
}
Error response
{
"message": "Key not found",
"code": "unauthorized"
}
Example
Input
{
"from":{
"from_name":"John",
"from_email":"sohansakhare****@gmail.com"
},
"to":{
"to_name":"David",
"to_email":"sajankumar.****@unicoco****.com"
},
"email_html":"<html><head></head><body><p>Hello world</p></body></html>",
"subject":"abc"
}
Output
{
"messageId": "<202410100***.1236169****@smtp-relay.mailin.fr>"
}