IntegrationsCommunication
Multi-provider email integration for Gmail, Outlook, Resend, and SendGrid
Send emails through multiple providers with unified configuration and Handlebars template support.
Overview
The Email integration is a building block that supports multiple email providers:
- Gmail - Google Workspace email via OAuth
- Outlook - Microsoft 365 email via OAuth
- Resend - Developer-friendly email API
- SendGrid - Transactional email platform
Prerequisites
| Provider | Requirements |
|---|---|
| Gmail | Google Workspace account, OAuth connection via Nango |
| Outlook | Microsoft 365 account, OAuth connection via Nango |
| Resend | Resend account, API key |
| SendGrid | SendGrid account, API key connection via Nango |
Authentication
Gmail / Outlook (OAuth)
Resend (API Key)
Set the RESEND_API_KEY environment variable or pass api_key in the step config.
SendGrid (API Key via Nango)
Email Step Configuration
The email step uses type email in workflow definitions:
Available Actions
send
Send an email immediately.
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be send |
provider | string | Yes | gmail, outlook, resend, sendgrid |
to | string/array | Yes | Recipient email(s) |
cc | array | No | CC recipients |
bcc | array | No | BCC recipients |
from | string | No | Sender address |
reply_to | string | No | Reply-to address |
subject | string | Yes | Email subject (supports templates) |
body.html | string | No | HTML body (supports templates) |
body.text | string | No | Plain text body (supports templates) |
attachments | array | No | File attachments |
headers | object | No | Custom email headers |
priority | string | No | Priority (1=high, 3=normal, 5=low) |
template_variables | object | No | Additional template variables |
sendTemplate
Send using a server-side template (SendGrid only).
Note: Gmail and Outlook do not support server-side templates. Use inline Handlebars templates with the send action instead.
schedule
Schedule an email for later delivery.
Scheduling Support:
| Provider | Native Scheduling |
|---|---|
| SendGrid | ✅ Yes |
| Resend | ✅ Yes |
| Gmail | ❌ No (use Trigger.dev scheduled tasks) |
| Outlook | ❌ No (use Trigger.dev scheduled tasks) |
Handlebars Templates
The email integration uses Handlebars for dynamic content:
Basic Variables
Conditionals
Loops
Nested Properties
Provider-Specific Features
Gmail
- Uses RFC 2822 message format
- Supports threading via
in_reply_toandreferences - Full attachment support with base64 encoding
Outlook
- Uses Microsoft Graph API
- Saves sent emails to Sent Items
- Supports importance levels
Resend
- Simple API-first design
- Direct API calls (no Nango required)
- Supports scheduling
SendGrid
- Server-side templates with dynamic data
- Open and click tracking
- Scheduling support
Example Workflow
Invoice email workflow:
Attachments
Base64 Content
Multiple Attachments
Rate Limits
| Provider | Limit |
|---|---|
| Gmail | 2,000 messages/day (free), higher for Workspace |
| Outlook | 10,000 messages/day |
| Resend | Based on plan |
| SendGrid | Based on plan |
Troubleshooting
Common Errors
| Error | Cause | Solution |
|---|---|---|
connectionId is required | No OAuth connection | Set up connection via Nango |
Resend API key not found | Missing API key | Set RESEND_API_KEY env var |
template is required | Using sendTemplate without template | Provide template.id |
provider does not support server-side templates | Gmail/Outlook with sendTemplate | Use send action with inline templates |
provider does not support native scheduling | Gmail/Outlook with schedule | Use Trigger.dev scheduled tasks |
Template Rendering Issues
- Ensure all template variables exist in the context
- Use
{{#if variable}}for optional fields - Check for typos in variable paths