A lightweight PHP-based subscription system that allows users to sign up using their email, verify through a code, and then receive a random XKCD comic every day. A scheduled CRON job runs every 24 hours to fetch a new comic and deliver it to all verified subscribers.
- Email registration & verification
- Daily comic delivery using the official XKCD JSON API
- Automatic CRON execution every 24 hours
- Simple, clean PHP implementation
- Easy to deploy on any server
- No heavy frameworks required
- A user enters their email on the subscription page.
- The system generates a verification code and emails it to the user.
- After verification, the user becomes an active subscriber.
- A CRON job runs daily:
- Fetches a random XKCD comic
- Extracts the title, image, alt-text, and link
- Sends the comic to every subscriber
- The process repeats automatically every 24 hours.
- PHP (any modern version)
- Working email configuration (SMTP or PHP mail)
- CRON job access
- Basic HTML/PHP hosting
- Clone the repository:
git clone https://github.com/WHitE-TITaN/Subscription-System- Configure your email sending settings in the PHP files.
- Ensure your server supports PHP mail or SMTP.
- Set up the CRON job:
bash
0 0 * * * php /path/to/your/project/sendComic.php
(Runs every midnight β adjust as needed)- Deploy on your server and you're good to go!
- Customize the verification email template
- Customize the daily comic email
- Adjust CRON frequency
- Add optional unsubscribe functionality
- Extend to other APIs or daily content
Subscription-System/
βββ assets/ # Static assets or helper files <br>
βββ api/ # API-related scripts <br>
βββ scripts/ # CRON-based scripts <br>
βββ email/ # Mail templates and sending logic <br>
βββ index.php # Main entry point <br>
βββ verify.php # Handles email verification <br>
βββ README.md # Project documentation <br>
Want to improve the project? Awesome! You can help by:
- Enhancing email templates
- Improving database or file storage
- Adding logging & error tracking
- Integrating PHPMailer for better reliability
- Pull requests are always welcome!