Send personalized appreciation certificates to employees

Stay organized with collections Save and categorize content based on your preferences.

Coding level: Beginner
Duration: 15 minutes
Project type: Automation with a custom menu

Objectives

  • Understand what the solution does.
  • Understand what the Apps Script services do within the solution.
  • Set up your environment.
  • Set up the script.
  • Run the script.

About this solution

Automatically customize the Google Slides Employee Certificate template with employee data in Google Sheets, then send the certificates using Gmail.

Employee certificate creation

How it works

The script uses the Employee Certificate presentation template from Slides and a Sheets spreadsheet with the employee details. The script copies the template and replaces the placeholders with data from the spreadsheet. Once the script creates a slide for every employee, it extracts each individual slide as a PDF attachment and sends the certificates to the employees.

Apps Script services

This solution uses the following services:

  • Drive service–Copies the Slides Employee Certificate template.
  • Spreadsheet service–Provides the employee details and updates the status against each listed employee.
  • Slides service–Replaces the placeholders in the presentation with the employee data from the spreadsheet.
  • Gmail service–Gets the individual slides as PDFs and sends them to the employees.

Prerequisites

To use this sample, you need the following prerequisites:

  • A Google Account (Google Workspace accounts might require administrator approval).
  • A web browser with access to the internet.

Set up your environment

  1. Click the following button to make a copy of the Employee certificates Slides template.
    Make a copy

  2. Take note of your presentation ID for use in a later step. You can find the ID in the URL:

    https://docs.google.com/presentation/d/PRESENTATION_ID/edit

  3. In Drive, create a new folder to hold the certificates.

  4. Take note of your folder ID for use in a later step. You can find the ID in the URL: https://drive.google.com/drive/folders/FOLDER_ID

Set up the script

  1. Click the button below to make a copy of the Employee certificates sample spreadsheet. The Apps Script project for this solution is attached to the spreadsheet.
    Make a copy

  2. In the spreadsheet, open the Apps Script project by clicking Extensions > Apps Script.

  3. For the slideTemplateId variable, replace PRESENTATION_ID with the ID of your presentation.

  4. For the tempFolderId variable, replace FOLDER_ID with the ID of your folder.

  5. Click Save Save icon.

Run the script

  1. Switch back to the spreadsheet and click Appreciation > Create certificates. You might need to refresh the page for this custom menu to appear.
  2. When prompted, authorize the script. If the OAuth consent screen displays the warning, This app isn't verified, continue by selecting Advanced > Go to {Project Name} (unsafe).

  3. Click Appreciation > Create certificates again.

  4. Once the status column of all the rows has been updated to Created, click Appreciation > Send certificates.

Review the code

To review the Apps Script code for this solution, click View source code below:

View source code

Code.gs

solutions/automations/employee-certificate/Code.js
/**
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

function myFunction() {

}

Contributors

This sample was created by Sourabh Choraria, blogger and Google Developer Expert.

This sample is maintained by Google with the help of Google Developer Experts.

Next steps