
Twilio SendGridMailSend
CertifiedSend workflow email through SendGrid
Twilio SendGridMailSend
Send workflow email through SendGrid
Delivers HTML or text emails with optional attachments using the SendGrid API and an API key. Supports inline images and fails the task on non-2xx responses.
type: io.kestra.plugin.twilio.sendgrid.SendGridMailSendExamples
Send an email on a failed flow execution.
id: unreliable_flow
namespace: company.team
tasks:
- id: fail
type: io.kestra.plugin.scripts.shell.Commands
runner: PROCESS
commands:
- exit 1
errors:
- id: send_email
type: io.kestra.plugin.twilio.sendgrid.SendGridMailSend
from: hello@kestra.io
to:
- hello@kestra.io
sendgridApiKey: "{{ secret('SENDGRID_API_KEY') }}"
subject: "Kestra workflow failed for the flow {{flow.id}} in the namespace {{flow.namespace}}"
htmlTextContent: "Failure alert for flow {{ flow.namespace }}.{{ flow.id }} with ID {{ execution.id }}"
Properties
from *string
1Sender email address
Must comply with RFC 2822 formatting
sendgridApiKey *string
1SendGrid API key
API key used to authenticate SendGrid requests; store as a secret
to *array
1Recipient email addresses
Each address must comply with RFC 2822 format
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150attachments array
File attachments
List of files loaded from Kestra storage and attached to the email; delivered as downloadable attachments
io.kestra.plugin.twilio.sendgrid.SendGridMailSend-Attachment
Attachment filename
Filename presented to recipients, e.g., 'report.pdf'
Attachment URI
URI in Kestra internal storage that supplies the file content
application/octet-streamAttachment content type
MIME type for the attachment; defaults to application/octet-stream
cc array
Cc recipients
Optional carbon-copy recipients in RFC 2822 format
embeddedImages array
Inline embedded images
Images loaded from storage and attached with inline disposition for HTML content
io.kestra.plugin.twilio.sendgrid.SendGridMailSend-Attachment
Attachment filename
Filename presented to recipients, e.g., 'report.pdf'
Attachment URI
URI in Kestra internal storage that supplies the file content
application/octet-streamAttachment content type
MIME type for the attachment; defaults to application/octet-stream
htmlContent string
HTML body
Optional HTML content. When both HTML and text are provided, email clients treat them as alternatives and typically favor HTML.
subject string
Email subject
Optional subject line rendered from flow variables
textContent string
Plain text body
Optional text content. When both HTML and text are provided, clients choose based on capability.
Outputs
body string
Response body returned by the SendGrid API
headers object
Response headers returned by the SendGrid API
statusCode integer
0HTTP status code returned by the SendGrid API