Cloudflare Email Worker that receives BCC'd emails from SuperOps ticket notifications and posts formatted cards to Google Chat via webhook.
- SuperOps sends ticket notification emails with your worker address in BCC
- Cloudflare Email Routing forwards emails to the worker
- Worker parses the email and extracts ticket data
- Formatted card is posted to Google Chat via webhook
- Open Google Chat
- Go to the space where you want notifications
- Click the space name → Apps & Integrations → Webhooks
- Click Create webhook, give it a name, copy the URL
- Save this URL for Step 4
- Go to Cloudflare Dashboard
- Select your domain → Email Routing → Settings
- Add a subdomain for email routing (e.g.,
notifications.yourdomain.com) - Add the MX and TXT records Cloudflare shows you
- Email Routing → Email Workers → Create
- Name it whatever you want (e.g.,
superops-tickets) - Delete the default code
- Copy everything from
worker.jsin this repo and paste it in - IMPORTANT: Change line 6 to your SuperOps domain:
const SUPEROPS_DOMAIN = "my.yourcompany.io"; // <-- YOUR DOMAIN HERE
- Click Save and deploy
- Workers & Pages → click your worker → Settings → Variables
- Under "Environment Variables", click Add variable
- Variable name:
GCHAT_WEBHOOK - Value: paste the webhook URL from Step 1
- Click Encrypt (important!)
- Click Save
- Email Routing → Routing rules → Create address
- Custom address:
tickets(or whatever you want) - Action: Send to a Worker → select your worker
- Click Save
Your email address is now: tickets@notifications.yourdomain.com
- Go to SuperOps → Settings → Notifications
- Edit your ticket notification templates (see templates below)
- Add your worker email to the BCC field:
tickets@notifications.yourdomain.com
Done! New tickets and replies will now post to Google Chat.
You must use these exact templates for the worker to parse emails correctly.
Hi #Technician name,
A new ticket has been submitted.
Ticket #: #Ticket ID
Client: #Client name
Site: #Site name
Requester: #Requester name
Priority: #Ticket priority
Category: #Ticket category
Subject: #Subject
Description:
#Description
#Ticket link
Hi #Technician name,
You have a new reply on ticket ##Ticket ID.
Client: #Client name
Site: #Site name
Requester: #Requester name
Priority: #Ticket priority
Status: #Ticket status
Subject: #Subject
Reply from: #Replied By
#Reply
#Ticket link
| What to change | Where | Example |
|---|---|---|
| SuperOps domain | worker.js line 6 |
my.yourcompany.io |
| Google Chat webhook | Cloudflare Worker Variables | https://chat.googleapis.com/v1/spaces/... |
Not getting any notifications?
- Check your MX records are set up correctly for the subdomain
- Verify the routing rule points to your worker
- Make sure the BCC address in SuperOps matches your routing rule
Getting notifications but data is wrong/missing?
- Make sure your SuperOps templates match exactly (copy/paste from above)
- The labels like
Ticket #:,Client:,Priority:must be exact
Worker errors in Cloudflare logs?
- Check
GCHAT_WEBHOOKvariable is set and encrypted - Verify your Google Chat webhook URL is still valid
- Content truncates at 500 characters to keep cards readable
- Using a subdomain keeps your main domain's email (Google Workspace, etc.) working normally