Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every Tuesday morning, ClickRuntime loads your contacts from SendGrid.

  2. AI writes a short version of this week's tip for each industry in your list.

  3. Each contact gets the version for their industry through SendGrid, with their first name.

  4. 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

RunsWeekly
Send each contact a personalised weekly tip through SendGridtoday, 9:00Succeeded
Gmail · Send reportWeekly tip sent to 412 of 415 contacts. Industries: cafés, retail, software.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
personalised_weekly_emails_to_a_contact_list_via_sendgrid.pyexample
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?
From your SendGrid Marketing contacts, using fields such as first name and industry. Add a custom field if you want to personalise by something else.
How long is each tip?
Three or four sentences by default, so it reads quickly on a phone. You can ask for longer.
What if I have thousands of contacts?
Contacts are grouped by industry, and one version is written per group, which keeps the cost low for large lists.
What permissions does it need?
SendGrid Mail Send + Marketing read; Gmail send. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.