Send
Send an email with Gmail API
Send
Send an email with Gmail API
yaml
type: io.kestra.plugin.googleworkspace.mail.SendExamples
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
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
clientId *Requiredstring
clientSecret *Requiredstring
refreshToken *Requiredstring
to *Requiredarray
SubTypestring
accessToken string
attachments array
SubTypestring
bcc array
SubTypestring
cc array
SubTypestring
from string
htmlBody string
readTimeout integerstring
Default
120scopes array
SubTypestring
Default
["https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/gmail.readonly","https://www.googleapis.com/auth/gmail.send"]