Back to Blog

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:

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:

4. Building a Campaign Reporting Dashboard

Pull campaign statistics from the GMass API and display them in your SaaS dashboard. Key metrics to track:

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:

6. Google Workspace Deliverability Tips

GMass's advantage is Gmail's deliverability. To maximize it:

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