Initial Setup in Google Sheets
To begin, you need to set up a new Google Sheet which will act as the control center.
- Go to Google Sheets.
- Take an empty sheet and name it exactly: "An Editor".
- Next, click on Extensions, then click on Apps Script.
- A new Apps Script project will open. You will see a file named Code.gs selected.
Add the Backend Code
This is the main server-side code for your application. Copy the entire block below and paste it into the Code.gs editor, replacing any existing content.
After pasting the code, click the Save project icon (💾).
Add the Certificate Template
Now, create the HTML file for the certificate PDF.
- In the left-side panel, click the plus icon (+) next to "Files".
- Select HTML from the menu.
- A dialog box will appear. Enter the filename exactly: Certificate.html and press Enter.
- Copy the code below and paste it into the new Certificate.html file.
After pasting, click the Save project icon (💾).
Add the Certificate Email Template
This HTML file formats the email that will be sent to participants with their certificate.
- Click the plus icon (+) again.
- Select HTML.
- Enter the filename exactly: Certificate_Email.html and press Enter.
- Copy the code below and paste it into the new Certificate_Email.html file.
Once again, click the Save project icon (💾) to save all your files.
Deploy as a Web App
The final step is to deploy your script so it can be accessed via a URL.
- Look at the top right corner and click the blue "Deploy" button.
- From the dropdown, click "New deployment".
- A popup window will open. Click the small gear icon (⚙︎) next to "Select type".
- Choose "Web app" from the list.
- In the configuration section, set the following:
- Execute as: "Me"
- Who has access: "Only myself"
- Click the "Deploy" button at the bottom.
- You will be prompted to grant permissions. Click "Authorize access" and follow the on-screen instructions to allow the script to run.
- Finally, a screen will appear with your Web app URL.
This Web App URL is the most important part! Copy this URL and save it. You will need it to connect your editor application to this backend and create online tests.