Partnerships CRM
Partnerships CRM: Gmail Sync Setup
How to setup your Gmail to sync with the partnerships CRM
What Gmail Sync Adds
Gmail sync imports normal inbox activity into partner communication logs.
What gets synced:
- outbound messages sent from connected inbox
- inbound replies from partners
- message/thread IDs for dedupe
Where it appears:
- Partner detail -> Communications
- Overview sync health cards
Before You Start
- Use the same Gmail inbox you send partner outreach from.
- Open two tabs:
- Partnerships CRM Email Ops
- Google Apps Script
- Confirm your email domain is allowed by backend (
PARTNERSHIPS_EMAIL_SYNC_ALLOWED_DOMAINS).
Setup Steps
Step 1: Copy the script template from CRM
- Open
/admin/partnerships. - Go to Email Ops.
- Click Setup Guide.
- Copy the Apps Script template shown in the dialog.
The template already includes the correct ingest endpoint for your current backend.
Step 2: Create a new Apps Script project
- Go to https://script.new.
- Remove placeholder code.
- Paste the copied template.
- Save project as
Partnerships CRM Email Sync.
Step 3: Run once for Google permissions
- In Apps Script toolbar, pick function
syncPartnershipEmails. - Click Run.
- Approve permissions in Google consent flow.
- If you see an unverified warning:
- click Advanced
- click Go to ... (unsafe)
- continue and allow
This one-time run grants Gmail read + webhook post permissions.
Step 4: Create the time trigger
- In Apps Script, click Triggers (clock icon).
- Click + Add Trigger.
- Set:
- function:
syncPartnershipEmails - deployment:
Head - event source:
Time-driven - time-based type:
Minutes timer - interval:
Every 10 minutes(orEvery 15 minutes)
- function:
- Save.
Step 5: Verify in CRM
- Return to Email Ops.
- Click Refresh.
- Confirm:
- status changes to configured
Last Syncupdates- your inbox appears in
Synced Accounts
Multi-Exec Setup
Each exec should connect their own inbox with the same steps above.
Notes:
- this is expected behavior, not duplication
- actor email is tracked in sync status
- comm logs still dedupe by message/thread identifiers
What To Check If It Stops Working
Last Sync never changes
- Apps Script -> Executions -> open latest run
- confirm there are no runtime errors
- confirm trigger still exists and is enabled
Status says configured but imports stay zero
- send one real email from that inbox
- wait one trigger interval
- refresh Email Ops status card
Domain blocked error
- actor email domain is not allowed
- update backend env
PARTNERSHIPS_EMAIL_SYNC_ALLOWED_DOMAINS
Duplicate comm entries
- check if script payload includes stable message/thread ids
- dedupe logic relies on those identifiers
Payload Summary
Ingest route accepts actor + entries payload. Each entry can include:
- direction
- sender/recipient email fields
- subject/summary snippet
- occurred timestamp
- message/thread ids
- optional event context (
eventId,eventYear)
Backend normalizes and matches entries in services/partnerships/emailSync.js.
Related Docs
- outbound mail merge: Email Ops
- API routes and auth: Backend API
- incident handling: Troubleshooting