SendGridMailSend SendGridMailSend

yaml
type: "io.kestra.plugin.notifications.sendgrid.SendGridMailSend"

Send an automated SendGrid email from a workflow

Examples

Send an email on a failed flow execution

yaml
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.notifications.sendgrid.SendGridMailSend
    from: [email protected]
    to:
      - [email protected]
    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

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

The address of the sender of this email

sendgridApiKey

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

The SendGrid API KEY

to

  • Type: array
  • SubType: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min items: 1

Email address(es) of the recipient(s)

Note that each email address must be compliant with the RFC2822 format

attachments

Adds an attachment to the email message

The attachment will be shown in the email client as separate files available for download, or displayed inline if the client supports it (for example, most browsers display PDF's in a popup window)

cc

  • Type: array
  • SubType: string
  • Dynamic: ✔️
  • Required:

One or more 'Cc' (carbon copy) optional recipient(s) email address(es)

Note that each email address must be compliant with the RFC2822 format

embeddedImages

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

htmlContent

  • Type: string
  • Dynamic: ✔️
  • Required:

The optional email message body in HTML

Both text and HTML can be provided, which will be offered to the email client as alternative contentEmail clients that support it, will favor HTML over plain text and ignore the text body completely

subject

  • Type: string
  • Dynamic: ✔️
  • Required:

The optional subject of this email

textContent

  • Type: string
  • Dynamic: ✔️
  • Required:

The optional email message body in plain text

Both text and HTML can be provided, which will be offered to the email client as alternative contentEmail clients that support it, will favor HTML over plain text and ignore the text body completely

Outputs

body

  • Type: string
  • Required:

headers

  • Type: object
  • SubType: string
  • Required:

statusCode

  • Type: integer
  • Required:
  • Default: 0

Definitions

io.kestra.plugin.notifications.sendgrid.SendGridMailSend-Attachment

Properties

contentType
  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Default: application/octet-stream

One 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

name
  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The name of the attachment (eg. 'filename.txt')

uri
  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

An attachment URI from Kestra internal storage

Was this page helpful?