
SendGridMailExecution
The message will include a link to the execution page in the UI along with the execution ID, namespace, flow name, the start date, duration, and the final status of the execution. If failed, then the task that led to the failure is specified.
Use this notification task only in a flow that has a Flow trigger, as shown in this example. Don't use this notification task in errors tasks. Instead, for errors tasks, use the SendGridMailSend task.
The message will include a link to the execution page in the UI along with the execution ID, namespace, flow name, the start date, duration, and the final status of the execution. If failed, then the task that led to the failure is specified.
Use this notification task only in a flow that has a Flow trigger, as shown in this example. Don't use this notification task in errors tasks. Instead, for errors tasks, use the SendGridMailSend task.
Send a SendGrid email with the execution information.
The message will include a link to the execution page in the UI along with the execution ID, namespace, flow name, the start date, duration, and the final status of the execution. If failed, then the task that led to the failure is specified.
Use this notification task only in a flow that has a Flow trigger, as shown in this example. Don't use this notification task in errors tasks. Instead, for errors tasks, use the SendGridMailSend task.
type: "io.kestra.plugin.notifications.sendgrid.SendGridMailExecution"Examples
Send an SendGrid email notification on a failed flow execution.
id: failure_alert
namespace: company.team
tasks:
- id: send_alert
type: io.kestra.plugin.notifications.sendgrid.SendGridMailExecution
to:
- [email protected]
from: [email protected]
subject: "The workflow execution {{trigger.executionId}} failed for the flow {{trigger.flowId}} in the namespace {{trigger.namespace}}"
sendgridApiKey: "{{ secret('SENDGRID_API_KEY') }}"
executionId: "{{ trigger.executionId }}"
triggers:
- id: failed_prod_workflows
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatus
in:
- FAILED
- WARNING
- type: io.kestra.plugin.core.condition.ExecutionNamespace
namespace: prod
prefix: true
Properties
from*Requiredstring
1The address of the sender of this email
sendgridApiKey*Requiredstring
1The SendGrid API KEY
to*Requiredarray
1Email address(es) of the recipient(s)
attachmentsNon-dynamicarray
Adds an attachment to the email message
The attachment will be shown in the email client as separate files available for download or display.inline if the client supports it (for example, most browsers display PDF's in a popup window)
io.kestra.plugin.notifications.sendgrid.SendGridMailSend-Attachment
application/octet-streamccarray
One or more 'Cc' (carbon copy) optional recipient(s) email address(es)
customFieldsobject
Custom fields to be added on notification
customMessagestring
Custom message to be added on notification
embeddedImagesNon-dynamicarray
Adds image data to this email that can be referred to from the email HTML body
The provided images are assumed to be of MIME type png, jpg, or whatever the email client supports as valid image that can be embedded in HTML content.
io.kestra.plugin.notifications.sendgrid.SendGridMailSend-Attachment
The name of the attachment (eg. 'filename.txt')
An attachment URI from Kestra internal storage
application/octet-streamOne or more 'Cc' (carbon copy) optional recipient email address(es). Use semicolon as a delimiter to provide several addresses.
Note that each email address must be compliant with the RFC2822 format.
executionIdstring
{{ execution.id }}The execution id to use
Default is the current execution, change it to if you use this task with a Flow trigger to use the original execution.
htmlContentstring
The optional email message body in HTML
subjectstring
The optional subject of this email
templateRenderMapobject
Map of variables to use for the message template
textContentstring
The optional email message body in plain text
Both text and HTML can be provided, either will be offered to the email client as alternative content.Email clients that support it, will favor HTML over plain text and ignore the text body completely.
Outputs
bodystring
headersobject
statusCodeinteger
0