Every 10 minutes
Email billing about payment tickets as they arrive
New tickets about payments are tagged urgent in Zendesk, and your billing team gets an email about each one straight away.
- Runs
- Every 10 minutes
- Apps
- Gmail, Zendesk
- AI
- Yes, uses the built-in AI allowance
- Access
- Zendesk read+write; gmail.send
Send this to your assistant
Create a ClickRuntime automation: every 10 minutes, check new Zendesk tickets. If AI says a ticket is about a payment, refund or charge, tag it billing, set it to urgent and email billing@ with the details.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
At a subscription company, billing questions arrive in the same Zendesk queue as everything else, but the billing team works from email and the payment provider's dashboard, not Zendesk. Payment tickets wait for a support agent to notice them and forward them, and customers who were charged wrongly wait longer than anyone.
Spotting payment tickets as they arrive and emailing billing directly cuts out the hand-off, so money problems are fixed first.
What you get out of it
Money problems are handled first
Charges, refunds and failed payments are marked urgent the moment they arrive.
Billing stays in their own tools
The billing team gets an email with the details and a link, without needing a Zendesk seat.
No manual forwarding
Agents no longer have to notice payment tickets and pass them on.
Tagged for reporting
Every payment ticket carries a billing tag, so you can count them and spot trends such as a rise in failed renewals.
How it works
What happens, step by step
Every 10 minutes, ClickRuntime picks up tickets created or changed in Zendesk since its last check.
AI reads each new ticket and decides whether it is about a payment.
Payment tickets are tagged billing and set to urgent in Zendesk.
An email with the ticket link and the customer's message goes to your billing address from your Gmail.
It remembers where it got up to, so no ticket is escalated twice.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Zendesk
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Gmail and Zendesk steps into one automation
Under the hood
The code that runs this automation
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state
ZD, AGENT = "https://yourcompany.zendesk.com/api/v2", "you@yourcompany.com"
def zd(method, path, **kw):
r = http.request(method, ZD + path, auth=(f"{AGENT}/token", credentials.secret("ZENDESK_API_TOKEN")), **kw)
return r.raise_for_status() or (r.json() if r.content else None)
def send_gmail(to, subject, text):
raw = base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n{text}".encode()).decode()
build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users().messages().send(userId="me", body={"raw": raw}).execute()
@on_trigger
def run(event):
seen = set(state.get("seen") or [])
new = [t for t in (page := zd("GET", "/incremental/tickets/cursor.json", params={"cursor": state.get("cursor")} if state.get("cursor") else {"start_time": 0}))["tickets"]
if t["id"] not in seen and t["status"] == "new"]
report_fetched(len(new))
if not new:
return {"summary": "No new tickets"}
for t in new:
label = ai.generate(f"{t['subject']}\n{t['description'][:1500]}", system="Reply yes if this is about a payment, charge, refund or invoice, else no.",
max_output_tokens=3).text.strip().lower()
if label.startswith("yes"):
zd("PUT", f"/tickets/{t['id']}", json={"ticket": {"priority": "urgent", "additional_tags": ["billing"]}})
send_gmail("billing@yourcompany.com", f"Payment ticket #{t['id']}: {t['subject']}",
f"https://yourcompany.zendesk.com/agent/tickets/{t['id']}\n\n{t['description'][:1500]}")
seen.add(t["id"])
state.set("seen", sorted(seen)[-2000:])
state.set("cursor", page["after_cursor"])
return {"checked": len(new)}FAQ
Common questions
How does it know a ticket is about payments?
Who receives the email?
What does the email contain?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Draft replies to new tickets and email me the list
New Zendesk tickets get a suggested reply as an internal note, and you get an email listing which tickets are ready to review.
See how it worksGet a weekly email summarising your Zendesk tickets
Every Monday you get an email with the main themes in last week's tickets, how customers felt and anything unusual.
See how it worksFollow up on Zendesk tickets waiting on the customer
Each morning, customers whose tickets have been pending for a few days get a polite check-in email, and you get the list.
See how it worksKeep exploring
Set up “Email billing about payment tickets as they arrive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.