Mandala
Tools

Gmail

Send, read, search, and move Gmail messages or trigger workflows from Gmail events

Usage Instructions

Integrate Gmail into the workflow. Can send, read, search, and move emails. Can be used in trigger mode to trigger a workflow when a new email is received.

Tools

gmail_send

Send emails using Gmail

Input

ParameterTypeRequiredDescription
tostringYesRecipient email address
subjectstringNoEmail subject
bodystringYesEmail body content
contentTypestringNoContent type for the email body (text or html)
threadIdstringNoThread ID to reply to (for threading)
replyToMessageIdstringNoGmail message ID to reply to - use the "id" field from Gmail Read results (not the RFC "messageId")
ccstringNoCC recipients (comma-separated)
bccstringNoBCC recipients (comma-separated)
attachmentsfile[]NoFiles to attach to the email

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_draft

Draft emails using Gmail

Input

ParameterTypeRequiredDescription
tostringYesRecipient email address
subjectstringNoEmail subject
bodystringYesEmail body content
contentTypestringNoContent type for the email body (text or html)
threadIdstringNoThread ID to reply to (for threading)
replyToMessageIdstringNoGmail message ID to reply to - use the "id" field from Gmail Read results (not the RFC "messageId")
ccstringNoCC recipients (comma-separated)
bccstringNoBCC recipients (comma-separated)
attachmentsfile[]NoFiles to attach to the email draft

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectDraft metadata

gmail_read

Read emails from Gmail

Input

ParameterTypeRequiredDescription
messageIdstringNoID of the message to read
folderstringNoFolder/label to read emails from
unreadOnlybooleanNoOnly retrieve unread messages
maxResultsnumberNoMaximum number of messages to retrieve (default: 1, max: 10)
includeAttachmentsbooleanNoDownload and include email attachments

Output

ParameterTypeDescription
contentstringText content of the email
metadatajsonMetadata of the email
attachmentsfile[]Attachments of the email

Search emails in Gmail

Input

ParameterTypeRequiredDescription
querystringYesSearch query for emails
maxResultsnumberNoMaximum number of results to return

Output

ParameterTypeDescription
contentstringSearch results summary
metadataobjectSearch metadata

gmail_move

Move emails between Gmail labels/folders

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to move
addLabelIdsstringYesComma-separated label IDs to add (e.g., INBOX, Label_123)
removeLabelIdsstringNoComma-separated label IDs to remove (e.g., INBOX, SPAM)

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_mark_read

Mark a Gmail message as read

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to mark as read

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_mark_unread

Mark a Gmail message as unread

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to mark as unread

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_archive

Archive a Gmail message (remove from inbox)

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to archive

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_unarchive

Unarchive a Gmail message (move back to inbox)

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to unarchive

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_delete

Delete a Gmail message (move to trash)

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to delete

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_add_label

Add label(s) to a Gmail message

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to add labels to
labelIdsstringYesComma-separated label IDs to add (e.g., INBOX, Label_123)

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

gmail_remove_label

Remove label(s) from a Gmail message

Input

ParameterTypeRequiredDescription
messageIdstringYesID of the message to remove labels from
labelIdsstringYesComma-separated label IDs to remove (e.g., INBOX, Label_123)

Output

ParameterTypeDescription
contentstringSuccess message
metadataobjectEmail metadata

Triggers

gmail_poller

Triggers when new emails are received in Gmail (requires Gmail credentials)

Output

ParameterTypeDescription
email.idstringGmail message ID
email.threadIdstringGmail thread ID
email.subjectstringEmail subject line
email.fromstringSender email address
email.tostringRecipient email address
email.ccstringCC recipients
email.datestringEmail date in ISO format
email.bodyTextstringPlain text email body
email.bodyHtmlstringHTML email body
email.labelsstringEmail labels array
email.hasAttachmentsbooleanWhether email has attachments
email.attachmentsfile[]Array of email attachments as files (if includeAttachments is enabled)
timestampstringEvent timestamp

Notes

  • Category: tools
  • Type: gmail
Gmail