PHP – Correct Implementation of an Email Notification System

emailPHP

I'm looking to build an email notification system using codeigniter. Now the system in question is one of a 2nd hand online store. For example say person A would like a chair. When they search the system and nothing appears I would like them to subscribe to any notification regarding the chair. So when person B uploads a chair to be sold then everyone that subscribed to these notifications will be notified via email. This is what I'm looking to build, which for the most part is fairly easy.

My concern revolves around the sending of these emails. I would like to know what is the BEST way of sending these types of emails and a solution that scales well. So if 1000 people decide to follow the chair, the solution won't fall apart. I've read about mass email systems chocking servers, being marked as spam server etc. Would it be better to send these emails through a third party etc? If so which third party would be the most reliable and cost efficient for this given job?

Please note this is my first time I'm looking to do this and I'm just looking for guidance to get the job done "right" the first time round. Thank you in advance

Best Answer

Unfortunately, the "best" way of sending out emails of this nature is going to vary depending on the specifics of your project. There isn't a one-size-fits-all solution. If your user-base isn't very large, rolling your own solution can be a quick and easy way to get the job done. However, as your user base increases, so do the resources necessary to handle sending all of the emails in a reliable and timely fashion. At that point, you might consider a third party distributor. What point that is at, though, is going to depend on your budget (both from a fiscal and time perspective).

Regardless, a good design would decouple the sending of emails from the trigger that determines when those emails should be sent. At that point, replacing a solution should be a fairly painless process. I would say that - at least for testing - you ought to roll your own solution (which will make you familiar with any pitfalls), then see about using a third party service if the need arises.

Related Topic