HubSpot + MailOdds
Validate HubSpot contact emails, automate bounce suppression, score engagement with bot filtering, and detect high-intent leads. Direct Custom Code Actions for Operations Hub or middleware via Zapier and Make.
Prerequisites
- MailOdds account with API key
- HubSpot Operations Hub Professional+ (for Custom Code Actions)
- Or: Zapier / Make account (for middleware approach)
Custom Code Action Patterns
7 patterns using HubSpot Custom Code Actions (Operations Hub) to call the MailOdds API directly from workflows. Each runs as a Node.js function inside HubSpot with no external infrastructure.
Zero-Config Sending Domain Authentication
HubSpot users sending via MailOdds get automatic email authentication. Add one NS record for mo.yourdomain.com and MailOdds manages SPF, DKIM, MX, and DMARC automatically. No ongoing DNS maintenance.
Understanding is_bot and is_mpp in Webhook Events
is_bot = true when the event came from a security scanner, link prefetcher, or corporate email gateway (not a human). Common with Barracuda, Proofpoint, and Mimecast.
is_mpp = true when the event came from Apple Mail Privacy Protection, which pre-fetches all images and inflates open counts. Affects roughly 50% of iOS/macOS mail users.
Both fields are Booleans on engagement events (opened, clicked). Always guard with == true since they may be absent on non-engagement events.
Direct Validation via Custom Code Action
Validate emails in real time inside a HubSpot workflow. A Custom Code Action calls the MailOdds API with enhanced depth and writes status, action, and sub_status back to contact properties.
Two-Tier Cost-Optimized Validation
Run standard (syntax + DNS) validation first, then only promote qualified contacts to enhanced (SMTP) validation. Typical savings: 72% on validation costs for lists with high disposable/syntax-error rates.
Bounce-to-Suppression Pipeline
When MailOdds detects a hard bounce via webhook, automatically add the address to your suppression list. Prevents repeated sends to dead addresses and protects sender reputation.
Pre-Campaign List Audit
Before enrolling contacts in a campaign workflow, submit the entire list for batch validation. The Custom Code Action posts emails to the bulk endpoint, then a follow-up workflow processes results.
Contact Engagement Enrichment
Receive webhook events for opens and clicks, filter out bot and Apple Mail Privacy Protection noise, then update custom HubSpot properties with real human engagement data for lead scoring.
Telemetry Dashboard Sync
Pull aggregate validation and sending telemetry from the MailOdds API and sync it to custom HubSpot properties or an external dashboard. Uses ETag caching to minimize API calls.
Lead Scoring from Intent Events
Receive intent.hot_lead webhook events when MailOdds detects high-intent engagement patterns. Increment the contact lead score and create a task for the assigned sales rep.
Alternative: Middleware Integration (Zapier / Make)
If you are on HubSpot Starter or do not have Operations Hub, use Zapier or Make to connect HubSpot to MailOdds without Custom Code Actions.
Zapier
Watch contacts, validate, update properties
View guideMake
Visual CRM automation scenarios
View guiden8n
Self-hosted HubSpot API workflows
View guideZapier: Validate HubSpot Contact
JAVASCRIPT// Zapier Code Step - Validate HubSpot Contact Email
const response = await fetch('https://api.mailodds.com/v1/validate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: inputData.email // Mapped from HubSpot contact email
})
});
const result = await response.json();
return {
email: result.email,
status: result.status,
action: result.action,
is_valid: result.action === 'accept',
disposable: result.disposable
}; Make: HubSpot Validation Scenario
JAVASCRIPT// Make Scenario - HubSpot Contact Validation
// 1. HubSpot: Watch New Contacts (trigger)
// 2. HTTP Module: POST to https://api.mailodds.com/v1/validate
// Headers: Authorization: Bearer YOUR_API_KEY
// Body: { "email": "{{1.properties.email}}" }
// 3. HubSpot: Update Contact
// Property "email_validation_status" = {{2.data.status}}
// Property "email_action" = {{2.data.action}}
// 4. Router: Branch by action
// - "reject" -> Add to "Invalid Emails" list
// - "accept" -> Continue to enrollment workflows Custom Code Action Setup
Create Custom Contact Properties
In HubSpot Settings > Properties, create: email_validation_status (text), email_validation_action (text), email_sub_status (text), engagement_score (number), last_engagement_type (text).
Create a Workflow with a Custom Code Action
Go to Automation > Workflows. Create a contact-based workflow. Add a Custom Code action (requires Operations Hub Professional+). Map the contact email as an input field.
Paste the Validation Code
Copy the Direct Validation code from the first card above. Replace YOUR_API_KEY with your MailOdds API key. Define output fields matching the callback outputFields.
Map Output Fields to Contact Properties
After the Custom Code action, add a "Set Contact Property" action. Map email_status, email_action, and email_sub_status to your custom properties.
Configure Webhook Endpoints (Optional)
For engagement scoring and bounce suppression, set up webhook URLs in the MailOdds dashboard. Point them to a Zapier Webhook trigger or your own server that feeds into HubSpot workflows.
Build Segments on Validation Status
Create HubSpot active lists filtered by email_validation_action. Use "accept" for clean sends, "reject" for suppression, and "risky" for re-validation.
Frequently Asked Questions
Troubleshooting
Need more help?
Can't find what you're looking for? We're here to help you get HubSpot working.
Related Integrations
Clean Your HubSpot CRM Data
Get 1,000 free validations and start verifying HubSpot contacts today.