Blog
Cases

Automate your email signature distribution

DK
Dan Kowalsky
Founder ·

Every company has a "correct" email signature. Hardly anyone uses it.

Someone's still on the old logo. Someone wrote their job title in all caps. Someone's phone number is from two jobs ago, and one person has a quote in green italics. Nobody did anything wrong. Keeping signatures consistent just depends on everyone doing a fiddly, rare task by hand.

How we used to do it

At one company, the official signature lived in a Word document. To set yours up, you opened the doc, copied the template, typed your own name, title and phone number over the placeholders, and pasted it into Outlook. You hoped the formatting survived.

It mostly didn't. Fonts changed, the logo came out the wrong size, and people edited the template a little each time they copied it. A year later there were as many signatures as there were people.

So I built something better: a SharePoint page that used Microsoft Graph to pull in the signed-in person's details from their Microsoft 365 profile. You opened it, and your signature was already there with your name, title, department and phone, in the company's look. You copied it into Outlook and you were done.

It worked. People liked it. But it was a one-off. It was a page somebody had to know existed, built on its own, maintained by me, and separate from every other tool we had. New starters didn't find it, because nobody remembered to tell them about it. When the branding changed, I had to remember where the page lived and how I'd built it.

The automation was right. The problem was that it lived on its own instead of in the toolbox everyone already used.

Signatures as a tool in the toolbox

Callables turns Python functions into web tools your team opens from one place, with forms, run history and permissions. It's where the rest of our automations already live. So the signature generator belongs there too, next to the inbox tools and exports.

There are two versions in the Callables cookbook, and they share one template:

  • Set my Gmail signature sets your signature in Gmail directly through the Gmail API. Click run and it's done. Your next email has it.
  • Make my email signature builds the same signature for Outlook from your Microsoft 365 profile. Microsoft Graph has no way for apps to set an Outlook signature, so you get an HTML file to paste in once, with the steps.

Both run on the account of whoever runs them. Each person connects their own Google or Microsoft account once and approves what the tool asks for. After that, their run reads their profile and changes their own signature. Nobody hands around passwords, and the tool can't touch anyone else's settings. More on how that works in how to share a Python script that runs as each user.

One template for the whole company

The company's look lives in one place, brand/signature.py:

COMPANY = {
    "name": "Callables",
    "tagline": "Turn Python functions into tools your team can run",
    "website": "https://callables.app",
    "logo": "https://callables.app/brand/icon-192.png",
    "color": "#ff6b45",       # the divider
    "text_color": "#d9481f",  # the name and links
}

It renders a signature that survives email apps: a table with inline styles, a square PNG logo at a public address (email apps don't show SVGs, and recipients can't load a file from your computer), and every personal detail escaped. There's a classic style with the logo and a compact two-line style.

When the branding changes, you change this file and push. Everyone who runs the tool after that gets the new signature. There's no Word doc to replace and no page to hunt down.

Gmail: one click, nothing to paste

Here's the Gmail version, trimmed down:

@gmail.deploy(title="Set my Gmail signature", timeout=60)
def set_signature(style: Literal["classic", "compact"] = "classic", name: str = "",
                  job_title: str = "", department: str = "", phone: str = "",
                  save_to_gmail: bool = True) -> str:
    """Your signature in the company's style, set in Gmail for you."""
    client = Gmail(google.token)          # the token of whoever is running it
    account = client.send_as()            # your address and display name
    person = {
        "name": name or account["displayName"],
        "title": job_title, "department": department, "phone": phone,
        "email": account["sendAsEmail"],
    }
    signature = render(person, style)
    if account.get("signature"):          # keep the old one, in case they want it back
        save_file(page(account["signature"]), name="Previous signature.html")
    client.set_signature(account["sendAsEmail"], signature)
    return f"Your Gmail signature is now the {style} one."

The function's arguments become the form. Gmail already knows your name and address, so those come from Gmail. Gmail doesn't know your job title or phone, so you type them in. Your old signature comes back as a download before it's replaced, and you can turn off save to Gmail to preview it first.

It needs one extra permission on the Google connection, gmail.settings.basic, which lets an app change settings like your signature:

google = Connection("google", provider="google", scopes=["gmail.modify", "gmail.settings.basic"])

Outlook: your profile fills it in

The Outlook version is closer to my old SharePoint page. It reads your Microsoft 365 profile with Graph (/me), so your name, job title, department, phone and office fill themselves in. Any field you type in the form overrides the profile.

Graph can't set the signature, so the tool hands back the signature as an HTML file. You open it, copy everything, and paste it into Outlook's signature settings. The result includes the steps for new Outlook, classic Outlook and Outlook for Mac. It's one paste instead of retyping a template, and the formatting comes through intact.

The bonus: signatures as part of onboarding

Because the Gmail version sets the signature for you, it doesn't have to be a separate errand. It can be one step in an onboarding flow.

In Callables, any function can offer next actions with its result, with their inputs filled in from that result. So a new starter's first-day tool can end with a button that sets their signature, with their title and phone already filled in:

@onboarding.deploy(
    title="Start here",
    next=[Next(set_signature, label="Set my Gmail signature")],
)
def start_here() -> dict:
    """Everything you need on day one."""
    me = lookup_new_hire(...)  # from your HR system or a sheet
    return {"name": me.name, "job_title": me.title, "department": me.team, "phone": me.phone}

The new starter opens Start here, reads their checklist, and clicks Set my Gmail signature. The title and phone come from the HR data instead of being retyped, and the signature runs on their own account, so they connect Google once and it's done. The same flow can go on to the rest of day one: their accounts, their documents, their first tasks.

That's the difference from the SharePoint page. The page was a thing people had to be told about. Here, the signature is part of how someone joins the company.

Try it yourself

The cookbook is one Callables project. To run the Gmail version:

  1. Register a Google OAuth app by following the Google connector guide, with the scopes gmail.modify and gmail.settings.basic.
  2. Fork the cookbook, create a project from it on Callables, and set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in its secrets.
  3. Change COMPANY in brand/signature.py to your company's name, colours and logo, and push.
  4. Open Set my Gmail signature, connect your Google account, and run it.

For Outlook, follow the Microsoft connector guide with User.Read and open Make my email signature.

Or try it on your own machine first, with the client ID and secret in a .env file:

git clone https://github.com/callables-app/callables-cookbook && cd callables-cookbook
pip install callables -r requirements.txt
call connect google
call gmail set_signature --job-title "Founder" --save-to-gmail false

Leave --save-to-gmail false off when you're happy with the preview.

What else is living in a Word doc?

Email signatures are a small thing, but the pattern is everywhere: a process that "works" because it lives in a document, a one-off page, or one person's head. Each one is a small tool that could sit in the same place as everything else your team uses.

What's your company's version of the signature Word doc?

Turn your scripts into tools your team can run

Add @deploy to a Python function and push. Your team gets a form, schedules and run history.

See how it works

Keep reading