Skip to content

Comic Mailer using PHP which mails you comics every 5 minutes

License

Notifications You must be signed in to change notification settings

rishitaraha/Captain-Sem-s-Comics

Repository files navigation

Captain Sem's Comic Mailer

Comic Mailer using PHP which mails you comics every 5 minutes

Link to Project

Working of Code

  1. The Homepage consists of an input, the user enters a proper email and submits it, the user is then directed to enter the OTP

  2. Validation checks for EmailID and OTP is performed on both server-side and client-side.

  3. 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.

  4. Customised the mails to fit the website's theme.

  5. Added small animations in few places for a better and satisfactory user experience.

  6. 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.

  7. To avoid Injection, I've used prepared statements.

  8. For sending mails I've made use of SendGrid API

  9. 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.

  10. 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.

  11. Though, as of now the website isn't responsive, I have designed a separate page for mobile devices.

  12. Further improvements in this project could be - making the website responsive and adding properly designed loaders for processes that take time.

Screenshots

Desktop Screens

Home Page Screenshot 2021-09-29 at 12 17 33 PM

Verify OTP Screenshot 2021-09-29 at 12 18 07 PM

Successful Subscription Screenshot 2021-09-29 at 12 20 39 PM

Unsubscribe Screenshot 2021-09-29 at 12 24 09 PM

Error Screenshot 2021-09-29 at 12 21 13 PM

Mobile Screen

Screenshot 2021-09-29 at 12 21 13 PM

Notes

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.

About

Comic Mailer using PHP which mails you comics every 5 minutes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published