GMass Integration: Build a Custom Email Campaign Dashboard for Your SaaS
GMass is the go-to tool for sending mass emails directly from Gmail. But if you run a SaaS product — an agency tool, a CRM, or a sales automation platform — you may need to integrate GMass capabilities directly into your product. Here is how to do it.
1. When to Build a GMass Integration
You need GMass integration if your SaaS:
- Helps clients manage outbound email campaigns
- Runs sales sequences for multiple users from a single dashboard
- Needs to send personalized emails at scale via Gmail accounts
- Reports on email open, click, and reply rates across multiple campaigns
2. GMass API Authentication
GMass uses API key authentication. Each user connects their Gmail account to GMass and gets an API key. In your SaaS, store each user's GMass API key encrypted in your database.
const GMASS_API_BASE = 'https://api.gmass.co/api';
async function gmassRequest(apiKey: string, endpoint: string, payload?: object) {
const res = await fetch(`${GMASS_API_BASE}${endpoint}`, {
method: payload ? 'POST' : 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: payload ? JSON.stringify(payload) : undefined,
});
if (!res.ok) throw new Error(`GMass API error: ${res.status}`);
return res.json();
}
3. Creating and Sending Campaigns via API
With the GMass API you can create campaigns, schedule them, set follow-up sequences, and define personalization variables — all programmatically from your SaaS backend.
Key parameters for a campaign:
Subject: Email subject line (supports{FirstName}variables)Body: HTML or plain text email bodyListIdor inline recipientsScheduleDate: When to sendTrackOpens,TrackClicks: Analytics flagsAutoFollowUpEnabled: Automatic follow-up sequences
4. Building a Campaign Reporting Dashboard
Pull campaign statistics from the GMass API and display them in your SaaS dashboard. Key metrics to track:
- Sends, opens, clicks, replies, bounces, unsubscribes
- Open rate and click rate per campaign
- Reply rate (crucial for sales outreach)
- Inbox vs spam delivery rate
Cache campaign stats in your database and refresh on a schedule (every hour) rather than hitting the GMass API on every page load. Store historical data so users can see trends over time.
5. Multi-Account Management for Agencies
If you are building an agency SaaS where multiple team members run campaigns from different Gmail accounts, build a GMass account management system:
- Store each team member's API key encrypted
- Display combined reporting across all accounts in one dashboard
- Enforce sending limits per account to avoid Gmail throttling
- Alert when accounts approach daily limits (500 emails/day for regular Gmail, 2,000 for Workspace)
6. Google Workspace Deliverability Tips
GMass's advantage is Gmail's deliverability. To maximize it:
- Warm up new email accounts before launching campaigns
- Keep bounce rates below 2%
- Send from aged domains with SPF, DKIM, and DMARC records
- Segment lists and personalize — generic blasts to large lists hurt deliverability
7. Building the Integration in Supabase + Next.js
Store GMass configurations in a gmass_accounts table with encrypted API keys. Use server actions to create campaigns and a background job (cron route) to refresh stats. Display data using a charting library like Recharts in your dashboard.
Need a developer who has built email SaaS integrations? Hire me on Fiverr and get your integration shipped in 2–4 weeks.
Share this article