Help Centre › Functions & Formulas
This article describes the RPA Google Workspace connector function to send an email via Gmail.
For a full list of available functions, please read GOOGLE WORKSPACE functions.
Description
The Send email function sends an email via the Gmail API. The email must be provided as a base64url-encoded RFC 2822 message. This gives full control over headers, HTML body, and attachments.
Setting it up
{{popups:rpas/add:action=google-workspace-gmail-send}}
Once on a process map:
- Navigate to the process where you would like to add the function
- Click on the green button’s drop-down (right side of the green button labelled “Process”)
- On the menu that appears, click on the “+ Activity” item
- From here you can select the GOOGLE WORKSPACE Send email option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Connector | Yes | Select | - | Select the Google Workspace connector to use |
| Raw | Yes | Textarea | - | Base64url-encoded RFC 2822 email message including To, Subject, and body |
| Variable | Yes | Text | - | Variable to store the result |
Output variables
| Variable | Type | Description |
|---|---|---|
| Variable | Object | API response with id, threadId, and labelIds of the sent message |
Errors
- Invalid message format – the raw message is not valid RFC 2822
- Insufficient permissions – the app lacks gmail.send scope
Tips
- The raw field should contain a base64url-encoded email with headers like To:, Subject:, Content-Type:
- Use Python code or a helper step to construct and encode the RFC 2822 message
- For simpler email sending, consider using the Send email action in the Messaging category
Related functions
- List emails – List inbox messages
- Get email – Read an email by ID
- Trash email – Delete an email