Why Connect SendGrid to Odoo?
Odoo can send emails through any SMTP server, but SendGrid offers specialized email infrastructure — high deliverability rates, bounce management, spam compliance, and detailed analytics. Connecting SendGrid to Odoo ensures your transactional emails (invoices, order confirmations, password resets) and marketing campaigns reach inboxes instead of spam folders.
This integration is essential for businesses sending high volumes of email from Odoo, especially those with deliverability issues using basic SMTP providers.
Integration Types
1. SMTP Relay (Simple)
The fastest setup — use SendGrid as Odoo's outgoing mail server:
- No code changes required
- All Odoo emails route through SendGrid
- Basic delivery tracking in SendGrid dashboard
- Limited programmatic control
2. API Integration (Advanced)
Use SendGrid's Web API v3 for programmatic control:
- Template management with dynamic content
- Event webhook for delivery, open, click, bounce tracking
- Suppression group management
- Scheduled sending and batch operations
Setup: SMTP Method
1. SendGrid Configuration
- Create a SendGrid account and verify your sending domain
- Set up domain authentication (SPF, DKIM, DMARC records)
- Generate an API key with Mail Send permissions
- Note SMTP credentials: smtp.sendgrid.net, port 587, username "apikey"
2. Odoo Configuration
- Go to Settings → Technical → Outgoing Mail Servers
- Create new server: smtp.sendgrid.net, port 587, TLS encryption
- Username: apikey (literal text)
- Password: your SendGrid API key
- Test the connection with a test email
3. Domain Verification
Critical for deliverability:
- Add CNAME records for SendGrid domain authentication
- Configure SPF record to include SendGrid
- Set up DKIM signing through SendGrid
- Implement DMARC policy for your domain
- Verify records propagation using SendGrid's validation tool
Setup: API Method
1. Event Webhooks
Configure SendGrid to notify Odoo about email events:
- Create an Odoo controller endpoint to receive webhook POSTs
- Enable events: delivered, opened, clicked, bounced, spam report, unsubscribe
- Parse webhook payload and update Odoo mail.mail records
- Store engagement data for analytics and segmentation
2. Template Integration
- Design email templates in SendGrid's editor
- Use dynamic template data (handlebars syntax) for personalization
- Call SendGrid API from Odoo to send templated emails
- Pass Odoo record data as template variables
3. Bounce and Suppression Handling
- Sync SendGrid bounce lists to Odoo blacklist
- Mark bounced contacts in Odoo to prevent future sends
- Handle unsubscribe requests per CAN-SPAM/GDPR
- Clean mailing lists based on SendGrid engagement data
Email Analytics in Odoo
Track email performance inside Odoo:
- Delivery rates per email type (invoice, marketing, notification)
- Open and click rates per campaign
- Bounce categorization (hard bounce vs. soft bounce)
- Spam complaint tracking and trend analysis
- Engagement scoring per contact
Common Pitfalls
- Domain authentication — Skip this and your emails go to spam. Always complete SPF, DKIM, and DMARC setup.
- Warm-up — New SendGrid accounts need IP warm-up. Start with low volumes and increase gradually.
- Webhook security — Verify SendGrid webhook signatures to prevent spoofing.
- Rate limits — Free tier allows 100 emails/day. Upgrade for production use.
Getting Started
Deploy Odoo on DeployMonkey, configure SendGrid as your outgoing mail server, and verify your domain. The SMTP setup takes 15 minutes. API integration with webhooks takes a few hours but provides much richer engagement data.