Weekly
Send each contact a personalised weekly tip through SendGrid
Every week each subscriber gets a short tip written for them through SendGrid, and you get a send report in Gmail.
- Runs
- Weekly
- Apps
- Gmail, SendGrid
- AI
- Yes, uses the built-in AI allowance
- Access
- SendGrid Mail Send + Marketing read; Gmail send
Send this to your assistant
Create a ClickRuntime automation: every Tuesday at 9, send each contact in my SendGrid list a short tip personalised to their industry, then email me a report of how many went out.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A bookkeeping firm emails clients a weekly tip, but the same generic note goes to a café owner and a software company alike, and open rates keep falling. Writing separate versions for each kind of client isn't realistic for a small team.
Each Tuesday every contact now gets a tip shaped around their industry, sent through SendGrid. The firm gets a short report in Gmail with how many went out and any that failed.
What you get out of it
Relevant emails get read
A tip that speaks to someone's industry is far more likely to be opened than a general newsletter.
Stays in touch every week
A steady, useful email keeps the firm in mind when a client needs more help.
No extra writing
You set the week's topic once; the variations are written for you.
A report in your inbox
The send summary in Gmail tells you it went out without logging into SendGrid.
How it works
What happens, step by step
Every Tuesday morning, ClickRuntime loads your contacts from SendGrid.
AI writes a short version of this week's tip for each industry in your list.
Each contact gets the version for their industry through SendGrid, with their first name.
You get an email in Gmail with how many were sent and any that failed.
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 SendGrid
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
- Run it at a different time, more or less often, or only on weekdays
- 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 SendGrid steps into one automation
Under the hood
The code that runs this automation
import base64
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai
TOPIC = "Keep receipts for every business expense, even small ones."
@on_trigger
def run(event):
sg = {"Authorization": f"Bearer {credentials.secret('SENDGRID_API_KEY')}"}
contacts = http.post("https://api.sendgrid.com/v3/marketing/contacts/search", headers=sg,
json={"query": "email LIKE '%'"}).json()["result"]
tips, sent = {}, 0
for c in contacts:
industry = c.get("custom_fields", {}).get("industry", "small business")
if industry not in tips:
tips[industry] = ai.generate(f"Write a 3-sentence tip for a {industry} owner about: {TOPIC}", max_output_tokens=150).text
r = http.post("https://api.sendgrid.com/v3/mail/send", headers=sg,
json={"from": {"email": "tips@northwind-books.example"}, "subject": "Your weekly tip",
"personalizations": [{"to": [{"email": c["email"]}]}],
"content": [{"type": "text/plain", "value": f"Hi {c.get('first_name', 'there')},\n\n{tips[industry]}"}]})
sent += r.status_code == 202
msg = EmailMessage()
msg["To"], msg["Subject"] = "me", f"Weekly tip sent to {sent} of {len(contacts)} contacts"
msg.set_content(f"Industries: {', '.join(tips)}")
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
return {"sent": sent}FAQ
Common questions
Where does it get each contact's details?
How long is each tip?
What if I have thousands of contacts?
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
Sort outreach replies in Gmail into interested and not
Replies to your SendGrid outreach are read as they land in Gmail, labelled interested or not, and the hot ones are flagged in Slack.
See how it worksGet a daily news digest in Slack
Each morning your team gets a short summary of what's new on the sites and blogs you follow.
See how it worksFollow your stocks and crypto in Slack
During market hours you get a short update on the tickers you care about, with a heads-up on big moves.
See how it worksKeep exploring
Set up “Send each contact a personalised weekly tip through SendGrid” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.