Procedures

Automation procedures in the Gmail BDK Book.

to add a label to an (email)

Add a label to one or more emails.

Input Concepts

Concept
Description
Type
Required
Default Value

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

Concept
Description
Type

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)

FILTER - CAPABLE

Download an email attachment and return it as an IO object.

Input Concepts

Concept
Description
Type
Required
Default Value

The email containing the attachment

gmail email

Yes

Output Concepts

Concept
Description
Type

The attachment as an IO object

gmail attachment

Examples

Download an attachment

download the attachment

to forward an email

Forward an email to new recipients.

Input Concepts

Concept
Description
Type
Required
Default Value

The email to forward

gmail email

Yes

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

Concept
Description
Type

The sent email

gmail email

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)

FILTER - CAPABLE

Retrieve emails from a specified label in Gmail.

Input Concepts

Concept
Description
Type
Required
Default Value

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

Concept
Description
Type

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

Concept
Description
Type

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

Concept
Description
Type
Required
Default Value

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

Concept
Description
Type

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

Concept
Description
Type
Required
Default Value

The email to reply to

gmail email

Yes

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

Optional list of attachments to include in the reply

gmail attachment

No

Output Concepts

Concept
Description
Type

The sent email

gmail email

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

Concept
Description
Type
Required
Default Value

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

Optional list of file attachments.

gmail attachment

No

Output Concepts

Concept
Description
Type

The sent email

gmail email

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?