A PHP-based daily email comic subscription system for XKCD, built using file-based storage, HTML email formatting, Mailpit for testing, and CRON automation.
This project was inspired by the rtCamp Associate Software Engineer assignment and rebuilt as a personal showcase.
- ✅ Email subscription with verification (6-digit code)
- ✅ Unsubscribe flow with verification code
- ✅ HTML email format with latest XKCD comic
- ✅ Daily CRON job using
setup_cron.sh
- ✅ No external database – emails stored in
registered_emails.txt
- ✅ Responsive UI with theme toggle
- ✅ Tested using PHP 8.3 and Mailpit SMTP server
📁 All screenshots can be found inside the
/screenshots
folder.
- PHP 8.3 (No frameworks)
- Mailpit (SMTP testing)
- Git Bash (for CRON simulation on Windows)
- HTML + CSS (Custom dark/light UI)
-
Clone this repo:
git clone https://github.com/Ani811625/xkcd-comic-mailer cd xkcd-comic-mailer/src
-
Start Mailpit SMTP server:
mailpit
-
Launch
index.php
in your local server (e.g., XAMPP or PHP CLI). -
To send the daily comic manually:
php cron.php
-
To auto-schedule via CRON:
bash setup_cron.sh
xkcd-comic-mailer/
└── src/
├── index.php # Subscription page
├── unsubscribe.php # Unsubscription page
├── cron.php # Sends XKCD comics to emails
├── functions.php # All helper functions
├── setup_cron.sh # CRON job automation
├── registered_emails.txt # Stores subscribed emails
This project is for educational/demo purposes only and was developed as part of a hiring challenge simulation.