Skip to content

Send Grid Email

Category: Email

Description: This extension module allows sending an email to a specific mailbox using SendGrid. It is necessary to specify a variable containing the destination address and another variable containing the content of the message to be sent.

Functionality: Use this extension module to integrate email sending functionality via SendGrid into your applications or services.

Prerequisites

  1. SendGrid Account:

    • You must have an active SendGrid account. You can register on the SendGrid
    • Select the plan that best suits your needs. SendGrid offers free and paid plans with different service levels.
  2. Create Resource in Azure:

    • Sign in to the Azure Portal
    • In the Azure portal, click on Create a resource.
    • Search for "SendGrid" and click on Create.

Subsequently, from the SendGrid account in Azure, go to the Settings section and click on Manage. This will redirect you to the SendGrid configuration page, where you can view your API Key. If not, generate a new one.

Implementation

SendGrid API Key: String field where the API key provided by SendGrid must be entered to authenticate and authorize the sending of emails through their service.

Sender Email: String field where the sender's email address must be entered, which must belong to the domain configured in SendGrid.

Sender Name: String field where the name to be displayed as the sender of the email must be entered.

Email Recipient: String field where the primary recipient's email address must be entered.

CC Email Recipient: String field where the email addresses of additional recipients who will receive a copy of the email must be entered.

Email Subject: String field where the title or subject of the email must be entered, which will appear in the subject line.

Message: String field that allows entering the body of the email, which can be plain text or HTML content.

Attachment Entity: Dropdown list field that allows selecting the string-type entity where the attachment was stored. This process must be complemented with the RequestFile extension module from Methods Get.

Success Message: String field where the message displayed to the user when the email has been sent successfully must be entered.

Failure Message: String field where the message displayed to the user when the email could not be sent must be entered.

If the maximum of failed attempts is reached, the action flow will be interrupted and the description of the error will be passed to the selected intent with the name: 'SendGridEmail_Error': Dropdown list where the intent name for error handling must be selected. The error details will be available in the entity called 'SendGridEmail_Error'.

Implementation Example

Field Value
Nombre PruebaSendGridEmail
SendGrid API Key xxxxxxxxxxxxxxxxxxxxx
Email sender 'noreply@tudominio.com'
Sender name 'Prueba Lynn'
Email recipient 'usuario@gmail.com'.
Email recipient CC 'usuario2@gmail.com'
Email subject 'Bienvenido a Nuestro Servicio'
Message '<h1> Hello </h1>'
Entity containing the attachments entidadPrueba (Solo podrá utilizar este campo definiendo el adjunto en el módulo de extensión RequestFile)
Message when the email is sent successfully 'El correo electrónico ha sido enviado exitosamente'
Message when the email could not be sent 'Hubo un error al enviar el correo electrónico. Por favor, inténtalo de nuevo más tarde'
If the maximum of failed attempts is reached, the action flow will be interrupted and the description of the error will be passed to the selected intent with the name: 'SendGridEmail_Error' Error_Handler