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.