Comic Mailer using PHP which mails you comics every 5 minutes
-
The Homepage consists of an input, the user enters a proper email and submits it, the user is then directed to enter the OTP
-
Validation checks for EmailID and OTP is performed on both server-side and client-side.
-
The user can enter the OTP sent to their mail or they can even click on the link sent to their mail. On a successful subscription, they reach the same page "Successfully Subscribed" page.
-
Customised the mails to fit the website's theme.
-
Added small animations in few places for a better and satisfactory user experience.
-
To handle sending mails every 5 minutes, I am using a remote server. Initially, I tried handling the CRON job using a Windows Task Scheduler but then in that situation, I would have to keep my system ON the entire time. The same was the problem with using a loop in a batch file.
-
To avoid Injection, I've used prepared statements.
-
For sending mails I've made use of SendGrid API
-
As for animations using SVG, I understand using SVGs in HTML considerably increased the length of code. But since the website isn't performing a lot of operations, SVGs do not affect the performance of the website much.
-
I designed a separate error page for errors that couldn't be handled on the same page & needed redirection. Each response code is coupled with its corresponding message.
-
Though, as of now the website isn't responsive, I have designed a separate page for mobile devices.
-
Further improvements in this project could be - making the website responsive and adding properly designed loaders for processes that take time.
To see errors in heroku -- heroku logs -t
git push heroku branchname(main)
Setting Keys
heroku config:set S3_KEY=8N029N81 S3_SECRET=9s83109d3+583493190
Accessing keys
heroku config --app=captain-sems-comics
(appname in the argument)
-
You can access the hosted website by clicking on the badge above or from this link -> https://captain-sems-comics.herokuapp.com/
-
This repository runs well on a local Apache server but this hasn't been configured to be hosted on heroku. In the repository I hosted on heroku, the pathnames were configured based on
$_SERVER['DOCUMENT_ROOT']
(Reference: https://phpdelusions.net/articles/paths) -
The keys in this repository has been stored in a config file but on the repository hosted online, the variables are stored as Environment Variables
-
Since SendGrid API allows a maximum of 100 mails, if the limit is exceeded you won't receive any mails.