appscript.dev
Blog Docs Sheets Gmail Drive

How I generated 200 personalized certificates in minutes

A real Northwind event-day automation — 200 attendees, 200 PDFs, sent in under five minutes.

By Awadesh Madhogaria · Published Sep 18, 2025

Northwind ran a training day for 200 people, and every attendee was promised a personalised certificate within hours of finishing. The brief was simple and unforgiving: 200 attendees, each needing a personalised certificate, each emailed within hours of the event ending.

The danger was never difficulty — it was volume. Picture doing one certificate by hand: open the template, type the name and course, export a PDF, write the email, attach, send. Call it two minutes. Multiply by 200 and that is over six hours of fragile, repetitive work, the kind where attention slips and errors creep in exactly when you are tired. That is 200 chances to misspell a name or attach the wrong file.

So I did not do it by hand.

How the script works

The build was small because the inputs were already tidy: an Attendees sheet with name, email, and course, and a Doc template with {{name}} and {{course}} tokens. The script then runs a straightforward loop:

  1. It reads every row of the Attendees sheet.
  2. For each attendee, it copies the Doc template into Drive.
  3. It replaces {{name}} and {{course}} with that person’s details.
  4. It exports the finished Doc as a PDF.
  5. It emails the PDF to the attendee’s address.
  6. It moves to the next row and repeats.

Every certificate is built from the same template, so all 200 look identical. Total runtime was about four minutes — and it was the Gmail send quota, not the script, that paced it. The full version is in Generate personalized certificates for a name list.

What I’d do differently, and what it delivered

The script worked, but the shape was not optimal. The email step was the slow part, because every send waited on Gmail. Next time I would split the job in two: pre-generate all 200 PDFs the moment registrations close, then send them in parallel batches once the event ends. That way the generation work is done early and event-day only has to send.

Even so, the result was hard to argue with:

  • 200 personalised PDFs created and emailed in roughly four minutes.
  • An afternoon of fragile manual work reduced to a single script run.
  • Zero typos, because every certificate came from one template and one clean sheet.
  • The promise to attendees kept comfortably within the deadline.

When a task is “the same thing, 200 times”, the count is the whole problem. A script does not get bored, does not mistype, and does not slow down at 4pm.