Skip to content

Daily

Send personalised emails from a Google Doc template

Each person in your sheet gets an email written from your Google Doc template with their own name and company, and is marked as sent.

Runs
Daily
Apps
Google Docs, Google Sheets
AI
Not needed
Access
Doc read; Sheet edit

Send this to your assistant

Create a ClickRuntime automation: every day, send each unsent person in my Contacts sheet an email using my Google Doc template with their name and company filled in, then mark them Sent.

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

An events coordinator at a small conference company sends the same invitation to a few dozen sponsors and speakers, each with their name and company in the greeting. Writing them one at a time takes an afternoon, and mail-merge add-ons need to be set up again each time the wording changes.

Keeping the wording in a Google Doc and the recipients in a sheet means the copy can be edited by anyone who can write a document, and the list can grow during the week. Event teams, recruiters, account managers and small agencies use it for invitations, onboarding notes and follow-ups that should read as personal.

What you get out of it

  • The wording lives in a normal document

    Colleagues edit the template in Google Docs with comments and suggestions as usual. The next send uses the latest version without anyone copying text into another tool.

  • Each email reads as written for that person

    Names, companies and any other column you add are filled into the template. Recipients see a message addressed to them, not a bulk mail.

  • Add people over time

    New rows added during the week are picked up on the next daily run. People already marked as sent are never emailed again.

  • A clear record of who was contacted

    Each row is marked with the date it was sent. When someone asks whether a sponsor got the invitation, the answer is in the sheet.

How it works

What happens, step by step

  1. Once a day, ClickRuntime reads the text of your template Google Doc.

  2. It goes through the Contacts sheet and picks the rows not yet marked as Sent.

  3. For each person, the placeholders in the template are replaced with their name, company and other details, and the email is sent from your Gmail.

  4. The row is marked as Sent with the date, so nobody receives the same email twice.

Before it runs live

  • Connect Google Docs
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsDaily
Send personalised emails from a Google Doc templatetoday, 9:00Succeeded
Email · Sponsor invitationHi Alex, we'd love to have Northwind Traders as a sponsor at this year's Contoso Logistics Summit. The full sponsor pack is attached to this email.

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Docs and Google Sheets 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_emails_from_a_docs_template_and_sheet_list.pyexample
import base64
from datetime import date
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials

DOC_ID, SHEET_ID = "your-doc-id", "your-spreadsheet-id"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    doc = build("docs", "v1", credentials=creds, cache_discovery=False).documents().get(documentId=DOC_ID).execute()
    text = "".join(r["textRun"]["content"] for c in doc["body"]["content"] for r in c.get("paragraph", {}).get("elements", []) if "textRun" in r)
    values = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values()
    head, *rows = values.get(spreadsheetId=SHEET_ID, range="Contacts!A1:Z").execute()["values"]
    gmail, sent, status_col = build("gmail", "v1", credentials=creds, cache_discovery=False), 0, chr(65 + head.index("Status"))
    for i, row in enumerate(rows, start=2):
        rec = dict(zip(head, row + [""] * len(head)))
        if rec["Status"] or not rec.get("Email"):
            continue
        filled = text
        for k, v in rec.items():
            filled = filled.replace("{{" + k + "}}", v)
        subject, _, body = filled.partition("\n")
        msg = EmailMessage()
        msg["To"], msg["Subject"] = rec["Email"], subject.strip()
        msg.set_content(body.strip())
        gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
        values.update(spreadsheetId=SHEET_ID, range=f"Contacts!{status_col}{i}", valueInputOption="RAW",
                      body={"values": [[f"Sent {date.today().isoformat()}"]]}).execute()
        sent += 1
    return {"sent": sent}

FAQ

Common questions

How do I mark where names go in the template?
Use placeholders in double curly brackets that match your column headings, such as {{Name}} and {{Company}}. Any heading in the sheet can be used this way, for example {{Event date}} or {{Booth}}.
Which address are the emails sent from?
They are sent from the Gmail account you connect, so replies come back to your normal inbox and the messages appear in your Sent folder.
Where does the subject line come from?
The first line of the Google Doc is used as the subject, and the rest becomes the body. The subject can contain placeholders too, such as an invitation addressed to the company.
What permissions does it need?
Doc read; Sheet edit. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). 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 personalised emails from a Google Doc template” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.