The moment it happens
Send a certificate to everyone who passes your quiz
Anyone who scores over 80% on your quiz receives a PDF certificate with their name by email, and a copy is filed in Drive.
- Runs
- The moment it happens
- Apps
- Gmail, Google Drive
- AI
- Not needed
- Access
- Drive write; Gmail gmail.send
Send this to your assistant
Create a ClickRuntime automation: when my quiz form posts a result above 80%, fill my certificate template with their name, save the PDF to Drive and email it to them.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A training company runs short online courses that end in a quiz. Learners who pass expect a certificate the same day. Until now someone opened the template, typed in the name, exported a PDF and emailed it, one learner at a time, often days later.
This automation issues the certificate the moment a passing result comes in, so learners get it while the course is still fresh and the team keeps a filed copy of every certificate they have issued.
What you get out of it
Learners get their certificate straight away
A certificate that arrives minutes after passing feels like a reward, and is more likely to be shared on a profile or with an employer.
No more copy and paste
Names are filled in from the quiz result, so there are no typos and no evenings spent exporting PDFs.
A complete record of who passed
Every certificate is saved to Drive, which makes it easy to reissue one or confirm a learner's result later.
Your own design
The certificate uses your Google Docs template, so your branding, wording and signature stay as you made them.
How it works
What happens, step by step
Your quiz form sends each completed result to ClickRuntime.
ClickRuntime checks the score and stops if it is 80% or below.
It makes a copy of your certificate template and fills in the learner's name, the course and the date.
It saves the certificate as a PDF in your Drive folder and emails it to the learner from your Gmail account.
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 Google Drive
- Paste your automation's link into the other app's webhook settings
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
- Act only on the items that match your own rules, and skip the rest
- 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 Gmail and Google Drive steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import base64
from datetime import date
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_event, credentials
TEMPLATE_ID, FOLDER_ID = "your-template-doc-id", "your-certificates-folder-id"
@on_event
def handle(event):
r = event.json or {}
if float(r.get("score", 0)) <= 80:
return {"passed": False}
creds = Credentials(credentials.connection("google", "work"))
drive = build("drive", "v3", credentials=creds, cache_discovery=False)
copy = drive.files().copy(fileId=TEMPLATE_ID, body={"name": f"tmp {r['name']}"}).execute()
swaps = {"{{name}}": r["name"], "{{course}}": r.get("course", ""), "{{date}}": date.today().strftime("%d %B %Y")}
build("docs", "v1", credentials=creds, cache_discovery=False).documents().batchUpdate(documentId=copy["id"], body={"requests": [
{"replaceAllText": {"containsText": {"text": k}, "replaceText": v}} for k, v in swaps.items()]}).execute()
pdf = drive.files().export(fileId=copy["id"], mimeType="application/pdf").execute()
drive.files().delete(fileId=copy["id"]).execute()
drive.files().create(body={"name": f"Certificate - {r['name']}.pdf", "parents": [FOLDER_ID]},
media_body=MediaInMemoryUpload(pdf, "application/pdf")).execute()
msg = MIMEMultipart()
msg["to"], msg["subject"] = r["email"], "Your certificate"
msg.attach(MIMEApplication(pdf, Name="certificate.pdf"))
build("gmail", "v1", credentials=creds, cache_discovery=False).users().messages().send(
userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
return {"issued": r["email"]}FAQ
Common questions
How do I set up the template?
Can I change the pass mark?
What happens to learners who do not pass?
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
Turn sales call notes into a proposal draft in Drive
Send your call notes after a sales call and a proposal draft based on your template is saved in Drive, with the link in your inbox.
See how it worksSend new clients a shared Drive folder and welcome email
Each new client gets their own Drive folder from your template, shared with them, plus a welcome email with the link.
See how it worksSave client email attachments into Drive, one folder per company
Attachments from client emails are filed in Drive automatically, each in a folder named after the sender's company.
See how it worksKeep exploring
Set up “Send a certificate to everyone who passes your quiz” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.