Script-For-Sending-Emails-With-Attachment

This script is used to send bulk emails with attachment

Script For Sending Emails With Attachment

This script is used to send bulk emails with attachment for the core team members in DSC SASTRA Deemed to be University. This script may not be the best one, still it works fine.

Check out the Documentation in GitHub Pages site

Note:
Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications (definition from here.) Code.js is the same file you see in the App Script Console as Code.gs.

Set Up

  1. Create a Spreadsheet and fill the columns
  2. Create a Script Project from same Spreadsheet
  3. Copy the code from Code.js into Code.gs (in App Script Console) and the email_template.html
  4. Upload the certificates into CoreTeamCertificates folder in the Google Drive
  5. Run the app script, and give the permission required
  6. Run the app script from the spreadsheet
  7. Output

1. Create a Spreadsheet and fill the columns

This script works on a spreadsheet with the columns as specified in the below image. spreadsheet-creation

2. Create a Script Project from same Spreadsheet

Click Script Editor from Tools Menu a new tab opens up with a new app script project. Screenshot (492)

3. Copy the code from this repo into the app script project created in the above step

4. Upload the certificates into CoreTeamCertificates folder in the Google Drive

Create a new folder CoreTeamCertificates in your Google Drive and upload all the genrated certificates there. Certiface generation is not handled in this project.

5. Run the app script, and give the permission required

Click the Run ( right filled-arrow ) button

1

Click the Review Permissions

auth 0

Choose the account in which the spreadsheed has been created and certificates has been uploaded

auth 1

Click Advanced

auth 2

Click Go to Team Certificate Distribution(unsafe)

auth 3

Click Allow

auth 4

6. Run the app script from the spreadsheet

Click Send Certificates from Automation Menu Screenshot (494)
Make sure that you run the function onOpen() so that you can see the Automation Menu. 1

7. Output

sheets 1

Thanks to GSmart blog for helping me to grasp the idea to write this script.