Google Workspace Send

Google Workspace Send

Certified

Send an email with Gmail API

Sends a message using OAuth Gmail access. Supports text/HTML bodies, CC/BCC, and attachments from kestra:// URIs.

yaml
type: io.kestra.plugin.googleworkspace.mail.Send

Send a simple text email

yaml
id: send_simple_email
namespace: company.team

tasks:
  - id: send_email
    type: io.kestra.plugin.googleworkspace.mail.Send
    clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
    clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
    to:
      - recipient@example.com
    subject: Test Email
    textBody: This is a test email from Kestra

Send an HTML email with CC and attachments

yaml
id: send_rich_email
namespace: company.team

tasks:
  - id: send_rich_email
    type: io.kestra.plugin.googleworkspace.mail.Send
    clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
    clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
    to:
      - recipient@example.com
    cc:
      - cc1@example.com
      - cc2@example.com
    subject: Rich Email
    htmlBody: "<h1>Hello</h1><p>This is a <b>rich</b> email!</p>"
    attachments:
      - /path/to/file.pdf
      - /path/to/image.png
Properties

OAuth client ID

Google OAuth 2.0 client ID for the Gmail project

OAuth client secret

Google OAuth 2.0 client secret

OAuth refresh token

Refresh token obtained via OAuth consent; used to mint access tokens

SubTypestring

To recipients

Primary recipient email addresses

OAuth access token

Optional access token; if absent, one is fetched from the refresh token

SubTypestring

Attachments

List of kestra:// file URIs to attach

SubTypestring

BCC recipients

Blind carbon copy addresses

SubTypestring

CC recipients

Carbon copy addresses

From address

Sender email; defaults to authenticated Gmail user

HTML body

HTML content

Reference (ref) of the pluginDefaults to apply to this task.

Default120

The read timeout for the request (in seconds)

SubTypestring
Default["https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/gmail.readonly","https://www.googleapis.com/auth/gmail.send"]

The OAuth scopes to use

List of OAuth 2.0 scopes required for the operation

Subject

Subject line

Plain text body

Plain text content

Sent message ID

Thread ID of sent message