Custom Certificates
| 7 minutes read | Level: Advanced | Last Updated: December 2025 |
Overview
This feature enables the organization using Glific to provide personalized certificates and/or badges to the contacts upon completion of a certain task or action or a desired behaviour recorded through the flows.
Using this feature organizations can upload multiple certificate or badge templates, and share these for the contacts having their personalized information such as "name", or "course participation", "course completion" details or any other such contact specific details be printed on the certificates and have the certificate shared with the contacts through the flows.
In effect, this feature also enables users to create visual gamified elements such as leaderboards, progress ring/bar, progression to milestones etc, that can be sent out through flows.
Pre-requisites
Google Cloud Studio Setup
- Enable Slides API Use this wizard on the selected project in the Google Developers Console. This will automatically turn on the Slides API.
- Enable Drive API Use this wizard on the selected project in the Google Developers Console. This will automatically turn on the Drive API.
- Create a new service account on the Google Cloud which has the “editor” permission to the Google Cloud Studio. Go to Google Cloud Console, and ensure that you’re in the right project. (same project which has the BigQuery and Google Cloud Storage bucket linked to your Glific account)
- a. Go to API and Services.
- b. Go to
Credentials->Create Credentials-> SelectService Account
- c. Give the service account an appropriate name.
- d. Give the the “editor” access and complete the creation.
- e. Once the service account is created, new keys need to be generated.
- f. Go to
manage keys->Create new key-> selectjson. - g. This downloads the json file
- h. These JSON needs to be copied into the
Google Slidesprovider on theSettingspage
Setup on Glific
Go to Settings -> Google Slides -> Activate this setting and enter the json key that was generated in the earlier step.
Aspect Ratios
For best results:
- Landscape certificates: Use a resolution of 3300 x 2550 px.
- Portrait certificates: Use resolution of 816 x 1056 px
- Badges: Use a square format, resolution of 600 x 600 px.
To change the page dimensions for a google slide
- Go to
file->page setup->custom. - This provides the menu to alter the dimensions of the page
- It is advised to research on your own behalf for the most suitable aspect ratio of the base template that suits your use case.
Sending the certificates/badges to contacts
Note: If you see the .PPTX label (like in the image below), your file is still in PowerPoint format and needs to be converted into Google Slides to work with custom certificates.
To convert it:
- Open the PPT in Google Slides.
- Once the file opens, click File on the top toolbar and Save as Google Slides.
The presentation will open in a new window and automatically save in your Google Drive as a Google Slides file. We need to use the new slide in the certificates.
1. Create/ Import template design in Google Slides
- For certificates created on canva or other softwares, export the designs as “ppt” and save it on your computer
- Convert them to Google Slides format as described above(if they are still in ppt format).
- The design template should have placeholders where the personalized information for the Glific contacts will be populated.
- Create the new slide file
- Go to “import slides” in “files”
- Select “upload” and “browse” to get the ppt file
- Import the file and see it as slide 2 on your ppt.
- This url on 2nd slide will be used to create the certificate template on Glific.
- Provide editor access to the google service account’s client email address.
- Certificate url is the link to the google slide template taken by copying the link.
- Ensure that the slide template does not end with “...slide=id.p1”
- Ensure that the slide template is saved on the Google Drive linked to organization email id.
- Create the slides inside a folder located in the shared drive. Then, share that folder with the service account and assign it the Content Manager role.
2. Save the certificate template in Glific
-
On the Glific platform, go to
Flows->Certificates->Createto add a new certificate template -
Add a title, description (optional), and the certificate url (see step 6 in above section
-
The design template is now saved.
-
The placeholders need to be added as 1 or 2. In single curly braces with the numbers.
-
Ensure that the placeholders have a large enough text field to accommodate the information for contact being sent
-
The certificate is saved, and the copy id button can be used to refer back to the template while using the webhook in Glific flow. (refer steps ahead)
3. Use the certificate template in the flow
- Add a
Call a webhooknode.
- By default,
FUNCTIONwould be selected. Leave this as it is.
- In the
FUNCTIONfield, select the pre-defined functioncreate_certificatefrom the dropdown.
- Give it an appropriate result name.
- Add the parameters in the
FUNCTION Body.
- Go to
Function Bodyon top right corner. You would see the following.
- Ensure that the following parameters are passed to the webhook
{
"certificate_id": 5,
"contact": "@contact",
"replace_texts": {
"{1}": "@contact.name"
}
}
- Here the
certificate_idhas to be taken from the certificate list page by using thecopy idbutton for the certificate generated. ”contact”: “@contact”has to be kept as it is. This enables the webhook to have access to all the contact variables being referenced in the webhook.”replace_texts”parameter should contain the placeholders that should be replaced in the design template. The format for replace text has to be following
“replace_texts”: {
“{1}” : “@contact.fields.preferred_name” ,
“{2}” : “@results…” }
- Ensure that the placeholders on the template are the same as the placeholder replacement texts being referred in the webhook function body are matching.
- The certificate url being generated can be used in the next
Send a messagenode by going to theattachmentsand calling theExpression - Based on the webhook result name defined, the Google Cloud media url is can be called by
@results.webhookresult.certificate_url
Error Handling
1. Use the following validation before the create_certificate webhook call to ensure that the certificates are not generated for contacts for whom the placeholder parameters value is not present
- a. Use the below expression to check if the variables being sent in the webhook indeed have a value for the given contact and do not end up printing a certificate like error 1 shared above.
<%= ["@contact.name", "@contact.abcd"] |> Enum.any?(&String.starts_with?(&1, "@")) %>
- b. For more than 2 variables, add further commas in the first list and add the variable names in double quotes.
- c. For just one variable, use split by custom expression and plainly enter the name of the variable and check for the condition “has only the phrase” and the variable name as shown in the screenshot.
- d. The above expression returns the value true if any of the variables start with “@..” which indicates that the variable is empty.
- c. This method can be used to avoid sending certificates for contacts where the variable is not present.
2. To catch certificates non-generation due to api level problems.
- a. Insert the following split by expression right after the webhook. Use
@results.webhookresultname.successcontainstruewhen the certificate url is generated. - b. Use this condition to share a relevant message to inform the contact of certificate generation
3. “Error 1: URL ending with slide=id.p”
This error happens because the id after slide indicates the location of the slide in the google drive and if the location is not present, then the code is not able to perform the steps like create a copy and replace the placeholder text with the variables from the webhook.
Steps to resolve
- a. Copy the root slide as slide 2 and slide 3
- b. Delete the slide 1 and 2
- c. Refresh the page
- d. See the slide url is now changed.
- e. Use this new url
4. “Error 2: Permission Issues”
Steps to resolve
- a. Ensure that the design template is created in the google drive account linked to the org’s email id.
- b. Try by storing the template in a different location on the drive or on a different shared drive
Best practices
Since this feature uses Google Drive and Google Slides APIs internally, be aware of their rate limits. Running this flow for a very large number of contacts (e.g., thousands) in one go may:
-
Lead to certificate generation failures, or
-
Slow down the overall execution of the flow due to throttling by the APIs.
To avoid these issues:
-
Place the
create_certificatewebhook after aWait for Responsenode in the flow. This ensures certificates are generated only when the user actively responds, naturally throttling the process. -
If you want to generate in bulk and send in realtime without waiting for user activity, then run the flow in smaller batches (under 100 contacts) with some time-interval between each batch rather than for the entire contact list at once.