Gmail
Procedures and concepts for the Gmail integration.
Overview
Gmail is Google's comprehensive email service providing powerful messaging, organization, and collaboration features. This integration enables automated email sending, inbox management, message filtering, and email workflow automation. Streamline communication processes and enhance productivity through intelligent email automation.
Prerequisites
1. Required Books
The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:
Gmail
How to Add the Book(s)
Go to Books → All Books.
Search for the name of the book and click on it.
Click on Install or Add Connection to add the book to your agent.
If adding a connection, you'll be prompted for connectivity details.
Connectivity
This section outlines the available methods for connecting to the Book, along with the required configuration details for each.
Procedures
to add a label to an (email)
Add a label to one or more emails.
Input Concepts
label
The label to add.
text
Yes
(no default)
email
the email or emails to add the label to
gmail email or list of gmail email
Yes
(no default)
Output Concepts
email
the email: The email or emails with the label added
gmail email or list of gmail email
Examples
Add a label to emails
to create a (draft email)
Create a draft email in Gmail without sending it.
Creates a new draft with the specified recipients, subject, and body. The draft is saved in the Drafts folder and can be sent later.
Input Concepts
recipients
The list of recipient email addresses.
list of text or text
Yes
(no default)
subject
The subject line of the draft email.
text
Yes
(no default)
body
The plain text content of the draft email.
text
No
(no default)
html body
The HTML content of the draft email.
text
No
(no default)
cc recipients
Optional list of CC recipients.
list of text or text
No
(no default)
bcc recipients
Optional list of BCC recipients.
list of text or text
No
(no default)
Output Concepts
Examples
Create a simple draft email
Create a draft email with CC and BCC
Create a draft email with an attachment
to download an (email's attachments)
Get an email attachment as an IO object.
Input Concepts
Output Concepts
Examples
Download an attachment
to forward an email
Forward an email to new recipients.
Input Concepts
recipients
The recipients to forward the email to
list of text or text
Yes
(no default)
body
Optional additional message to include
text
No
(no default)
html body
Optional additional HTML message to include
text
No
(no default)
cc recipients
Optional CC recipients
list of text or text
No
(no default)
bcc recipients
Optional BCC recipients
list of text or text
No
(no default)
Output Concepts
Examples
Forward an email to someone
Forward an email with additional message
to get some (label's emails)
Get emails from a specified label in Gmail.
Input Concepts
label
The name of the label from which to retrieve emails.
text
Yes
(no default)
max result count
Maximum number of emails to retrieve (default: 10).
number
No
10
Output Concepts
the label's emails: List of GmailEmail objects representing the retrieved emails.
gmail email
Examples
Retrieve all emails from inbox
Retrieve emails with specific subject
to get the (vacation responder)
Get the user's Gmail vacation responder (out-of-office auto-reply) configuration.
Output Concepts
the vacation responder: The current vacation responder settings.
vacation responder
Examples
Check whether the out-of-office auto-reply is enabled
to list (labels)
Get all labels from the user's Gmail account.
Output Concepts
labels
A list of all labels.
text
Examples
List all labels
to remove a label from an (email)
Remove a label from one or more emails.
Input Concepts
label
The label to remove.
text
Yes
(no default)
email
The email or emails to remove the label from.
gmail email or list of gmail email
Yes
(no default)
Output Concepts
email
the email: The email or emails with the label removed
gmail email or list of gmail email
Examples
Remove a label from an email
to reply an email
Reply to an email.
Input Concepts
body
The body of the reply
text
No
(no default)
html body
The html body of the reply
text
No
(no default)
additional recipients
Additional recipients to include in the reply
list of text or text
No
(no default)
Output Concepts
Examples
Reply to an email
to send a (draft email)
Send an existing draft email.
Submits a previously saved draft for delivery. The draft is removed from the Drafts folder once sent. The input must be a draft email created by the create_draft procedure.
Input Concepts
Output Concepts
Examples
Send a draft email
to send an email
Send an email using Gmail API.
Input Concepts
recipients
The list of recipient email addresses.
list of text or text
Yes
(no default)
subject
The subject line of the email.
text
Yes
(no default)
body
The plain text content of the email.
text
No
(no default)
html body
The HTML content of the email.
text
No
(no default)
cc recipients
Optional list of CC recipients.
list of text or text
No
(no default)
bcc recipients
Optional list of BCC recipients.
list of text or text
No
(no default)
Output Concepts
Examples
Send a basic email
Send an email with CC and BCC
to update the (vacation responder)
Update the user's Gmail vacation responder (out-of-office auto-reply).
Set enabled to true to turn the auto-reply on, false to turn it off. Provide subject and body (and optionally html body) for the message. Optional start time and end time schedule when the responder is active. Optional restrict to contacts and restrict to domain limit who receives the auto-reply.
Input Concepts
Output Concepts
the vacation responder: The updated vacation responder settings as returned by Gmail.
vacation responder
Examples
Turn on a simple out-of-office message
Turn the vacation responder off
Concepts
Gmail email
A Gmail Email represents an email message in Gmail.
id
The unique identifier for the email.
text
thread_id
The unique identifier for the thread containing the email.
text
state
The state of the email (draft, unread, or read).
text
sender
The sender of the email.
text
message_id
The unique identifier for the message.
optional[text]
cc_recipients
The cc recipients of the email.
optional[list of text]
bcc_recipients
The bcc recipients of the email.
optional[list of text]
draft_id
The draft ID, if this email is a draft.
optional[text]
subject
The subject of the email.
optional[text]
plain_body
The plain text body of the email.
optional[text]
html_body
The html body of the email.
optional[text]
sent_date_time
The date and time the email was sent.
optional[datetime]
received_date_time
The date and time the email was received.
optional[datetime]
Gmail attachment reference
A Gmail Attachment Reference represents a reference to a file attached to an email in Gmail.
id
The unique identifier for the attachment.
text
email_id
The unique identifier for the email.
text
file_name
The name of the attachment.
text
file_size
The size of the file in bytes.
number
Gmail attachment
A Gmail Attachment represents a file with name.
file_name
The name of the attachment.
text
content
The content of the attachment.
file
Vacation responder
The Gmail vacation responder (out-of-office auto-reply) configuration.
enabled
Whether the auto-reply is currently turned on.
optional[boolean]
subject
The subject line of the auto-reply.
optional[text]
body
The plain-text body of the auto-reply.
optional[text]
html_body
The HTML body of the auto-reply.
optional[text]
restrict_to_contacts
Whether to send the auto-reply only to people in the user's contacts.
optional[boolean]
restrict_to_domain
Whether to send the auto-reply only to people in the user's domain.
optional[boolean]
start_time
When the auto-reply starts being active.
optional[datetime]
end_time
When the auto-reply stops being active.
optional[datetime]
Last updated
Was this helpful?

