A simple Google script that reads data from Google Sheets containing coupon-related data. And sends a daily mail with coupons that are active or are expiring that day.
Does it happen to you that when you receive coupons and discount vouchers, you keep them aside thinking that you'll use them soon.
But, then you totally forget about them?
You find them again after they've expired only to feel unnecessary regret.
This Google Sheet + Google Script setup is my attempt to solve that problem.
-
Open a new Google spreadsheet and add the columns:
- Source - The brand/provider of the coupon. Required
- Description - Brief Description about the coupon. Required.
- Discount Code - Discount code to be applied.
- Link - Link to any resource with additional information.
- Expiry - Coupon expiry date.
- Used - Whether the coupon has been used. Possible values - YES/NO
Note: It is important that these columns are in sequence. And are placed contiguously starting from cell A1. The actual text is unimportant.
-
Go to Extensions -> Apps Script
Note the project ID from the browser address bar. We'll need it.
https://script.google.com/u/0/home/projects/{project ID}/edit
You can skip to Step #8 by copy-pasting all the JavaScript files from src folder as files in the Apps Script Editor. Just replace the.js
extension with.gs
. -
Install clasp and perform login.
Use the same GMail account that was used to create the Google Sheet in Step #1. Or any account with proper access to that sheet. -
Clone this repo. Remove
".sample"
from the file names. -
Update the following values:
Value Location of file Description project ID .clasp.json The project ID from step 2 Mail recipient src/constants.js The email address you want weekly coupon status emails on Link to sheet src/constants.js The link will be added in the weekly coupon status email for quick access to the Google Sheet -
Run
clasp push
-
In the Apps Script Editor, open the file
triggers.js
. Run the functionstartTriggers
. -
Fill the Google sheet with coupon details and you'll start receiving emails every Saturday.