Procedures
Automation procedures in the Gmail BDK Book.
Make sure to add the Gmail BDK Book to your agent before using these automation 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
email
the email or emails to add the label to
gmail email
or list of gmail email
Yes
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
add a label to the email with
... the label is "IMPORTANT"
to download an (email's attachments)
Download an email attachment and return it as an IO object.
Input Concepts
Output Concepts
Examples
Download an attachment
download the 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
body
Optional additional message to include
text
No
html body
Optional additional HTML message to include
text
No
cc recipients
Optional CC recipients
list of text
or text
No
bcc recipients
Optional BCC recipients
list of text
or text
No
Output Concepts
Examples
Forward an email to someone
forward the email to "[email protected]"
Forward an email with additional message
forward the email to "[email protected]" with
... the body is "Please see the forwarded email below."
to get some (label's emails)
Retrieve emails from a specified label in Gmail.
Input Concepts
label
The name of the label from which to retrieve emails.
text
Yes
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
get some "INBOX"'s emails
Retrieve emails with specific subject
get some "INBOX"'s emails whose subject is "Important Meeting"
to list (labels)
List all labels in the user's Gmail account.
Output Concepts
labels
A list of all labels.
text
Examples
List all labels
list 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
email
The email or emails to remove the label from.
gmail email
or list of gmail email
Yes
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
remove a label from the email with
... the label is "IMPORTANT"
to reply an email
Reply to an email.
Input Concepts
body
The body of the reply
text
No
html body
The html body of the reply
text
No
additional recipients
Additional recipients to include in the reply
list of text
or text
No
Output Concepts
Examples
Reply to an email
reply to the email with
... the body is "This is a test reply"
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
subject
The subject line of the email.
text
Yes
body
The plain text content of the email.
text
No
html body
The HTML content of the email.
text
No
cc recipients
Optional list of CC recipients.
list of text
or text
No
bcc recipients
Optional list of BCC recipients.
list of text
or text
No
Output Concepts
Examples
Send a basic email
send an email with
... the recipients are ["[email protected]"]
... the subject is "Hello"
... the body is "This is a test email"
Send an email with CC and BCC
send an email with
... the recipients are ["[email protected]"]
... the subject is "Meeting Notes"
... the body is "Please find the meeting notes attached"
... the cc recipients are ["[email protected]"]
... the bcc recipients are ["[email protected]"]
Last updated
Was this helpful?