DEV Community

 Suryadipta Ghosh
Suryadipta Ghosh

Posted on

I made a WhatsApp reminder for important FIFA World Cup matches.

I have been a busy these vacation days with my personal projects. But being a football fan, I can’t afford to miss World Cup matches. Especially of the big names. It is the last World Cup of the players of my generation; who I grew up watching. It is the last dance of the stars who got me hooked: Ronaldo, Messi, Neymar, Modric, Neuer, and more. And for this reason, I don’t want to miss the major matches in group stages and knockout rounds.

I decided to make a simple WhatsApp reminder for me so that I have notifications of matches I want to watch without manually searching it up or missing out later. The teams I added are Brazil, Germany, Spain, France, Argentina, England and my favourite, Portugal.

For this, I needed 4 things. Firstly, a data of the matches and their dates and timings. Secondly, an execution engine, which checks for the timings and triggers the alerts. Then, a delivery channel is needed. Lastly, an automation which acts as a scheduler and runs periodically.
So for this, The first step was to create a matches.json to store the match timings in Indian Standard Time (IST).

Fig: Storing match data in matches.json

I didn’t want to complicate it by fetching data, so I hardcoded it. Next, I needed to figure out a way to actually go through this JSON and add a WhatsApp reminder for me. I got to know about the Twilio WhatsApp sandbox, which is a pre-configured environment for sending business initiated messages. I can use that to send my scheduled reminders.
I signed up for a Twilio account. After verification and filling preferences, I setup the Twilio WhatsApp sandbox. To begin testing, I connected to Twilio sandbox by sending a WhatsApp message from my device to the Twilio number (which was my own number). Twilio on a trial account lets you send messages to verified mobile numbers only. You need to get your Account SID and Auth token in order to run an automated script.
Now, we need a script to parse the JSON file and send reminders at predetermined intervals. I needed reminders at 12, 3 and 1 hour before the match. Since the script runs every hour, it won’t land exactly at the 12h/3h/1h mark. So I give it a ±30 min buffer. Which means: If a match is between 690–750 mins away, it counts as the 12h reminder. The time is calculated by a parseIST function which converts the "2026-06-17 22:30" string into a proper JS Date object. It appends +05:30 so JS knows it's IST and converts it to UTC internally. A minsToGo is set which calculates how many minutes from right now until kickoff. If it's negative, the match has already started. Now, we can loop over using this constant. For each match, it checks if the kickoff is within ±30 mins of the 12h, 3h, or 1h reminder window; and if so, builds and sends a WhatsApp message with the match details.
I tested it locally by running it on node. And it worked! (had to alter the times of some matches temporarily to trigger the scheduled times)

Fig: Snapshot of the reminder working properly.

To automate the running of this file, I added GitHub workflows. Firstly, setting up the Account SID, Auth Token and WhatsApp number in your repository secrets is required.

Fig: A snapshot of the GitHub Repository secrets page.

Then we create a remind.yml file in the Github Workflow directory of the repository. It sets up a scheduler which runs every hour (you can manually run it too in repository actions). And all set! This now gives me periodic reminders of the upcoming important messages on WhatsApp.

You can check the repository here: https://github.com/sxryadipta/worldcup-match-reminder

Top comments (0)