Gmail Send Email
Controlled node
Overview
Sends an email via Gmail on behalf of the authenticated user. This node requires a Gmail connection to be configured in the properties panel before use.
The node supports sending to multiple recipients (To, CC, BCC), plain text and HTML body content, and file attachments from the Intellectible library. Email addresses are validated before sending to ensure proper formatting.
Connection Required
You must configure a Gmail connection in the node's properties panel before this node can send emails. The connection determines which Gmail account the email is sent from.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Fires when the node should send the email | - |
| To | Text | Primary recipient email address(es). Can be a single email string or an array of email strings | - |
| CC | Text | Carbon copy recipient email address(es). Can be a single email string or an array of email strings | - |
| BCC | Text | Blind carbon copy recipient email address(es). Can be a single email string or an array of email strings | - |
| Subject | Text | The subject line of the email | - |
| Body Text | PlainText | Plain text version of the email body | - |
| Body HTML | PlainText | HTML version of the email body (optional) | - |
| Attachments | Data | File attachments to include. Can be a single file object or array of file objects from the library | - |
| Connections | Connection | The Gmail connection to use for sending (configured in properties panel) | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the email has been sent or if sending failed |
| Status | Data | Contains 'success' if sent successfully, or an error message if failed (e.g., 'failed: invalid email format') |
Runtime Behavior and Defaults
- Email Validation: All email addresses (To, CC, BCC) are validated against standard email regex patterns. If any email is invalid, the node will output a failure status and fire the Done event immediately without attempting to send.
- Attachment Format: Attachments must be file objects from the Intellectible library containing
idandnameproperties. If a single attachment object is provided, it is automatically wrapped in an array. - Body Content: If both Body Text and Body HTML are provided, both are sent. If only one is provided, that version is used.
- Error Handling: If the Gmail API returns an error (e.g., authentication failure, rate limiting), the error message is captured in the Status output and the Done event fires.
- Connection Requirement: The node will fail if no Gmail connection is selected in the properties panel.
Example Usage
Basic Email Send:
[Start Node]
↓ (fired event)
[Gmail Send Email]
To: "recipient@example.com"
Subject: "Hello from Intellectible"
Body Text: "This is a test email sent from a workflow."
Connections: [Your Gmail Connection]
↓ (done event)
[Show Node] ← Status output
Email with Attachments:
[Get Library Files] → (files output) → [Gmail Send Email]
To: ["user1@example.com", "user2@example.com"]
CC: "manager@example.com"
Subject: "Monthly Report"
Body HTML: "<h1>Report</h1><p>See attached.</p>"
Attachments: (connected from Get Library Files)
Error Handling Pattern:
[Gmail Send Email]
↓ (done event)
[If Node] ← Status output (test: contains "success")
↓ True ↓ False
[Success Handler] [Error Handler]