Contents
Overview
- This script written in NodeJS is a straightforward tool capable of generating and mailing certificates in bulk, utilizing data from a spreadsheet (.xlsx).
- The script creates certificates by utilizing a fillable PDF template and subsequently sends them to the designated email address.
- Initially, I developed this project for sending MLSA certificates in bulk. However, it can be customized to generate certificates with a template of your choice. For instructions on how to do this, please refer to the "Changing Certificate Template" section.
- Please note that there is limit on sending emails in bulk using a standard gmail account, so you may have to send in batches.
Setup for sending MLSA Certificates
1 Clone the repository using the command.
2 Open a terminal in the root folder of the project and install npm packages using the following command.
3 Completing the .env
file to initialize the mailer
- Create a file named as
.env
in the root folder of the project and copy the contents ofenv.txt
in it. - Put your Gmail id that will be used for mailing in front of "EMAIL" in the .env file.
- Obtain app password for your gmail id that will act as password and will be used to send emails by reffering this link https://support.google.com/mail/answer/185833?hl=en, and paste it in front of "EMAIL_PASS2" in the env.
4 Update the event details in the eventDetails.js
file.
5 Populate the data in the data.xlsx
file in the following format.
Name | |
---|---|
Name of the attendee | Email of the attendee |
6 Run the script using the following command.
7 Progress will be reported in the terminal as follows
Changing Certificate Template
1 To generate certificates, it is necessary to create a fillable PDF template. For guidance on creating one, please refer to the following link . Save the pdf as template.pdf
.
2 Update the eventDetails.js
file and add the fixed(That will be same in all certificates) properties that you created in the template pdf.
3 Updating the genCert.js
file to populate the new fixed properties.
4 Adding properties that will be populated from spreadsheet.