Sending emails in bulk through php and codeigniter -
Sending emails in bulk through php and codeigniter -
i building script takes user registration , upon registration sends email user email validation. upon validating email when user logs in there various activities user performs when automatic email sent other user whom user interacts on site.
for illustration when user sends private message follower on site automated email sent followers email address informs him of user activity performed.
now consider there around one thousand users on site perform around 2000 5000 activities of sending auto emails daily.
i using codeigniter
build website , know best approach through can design scheme email delivered without fail.
seems case event/message queue.
web generated events - registration, direct messages followers, etc - add together message/task/item work/message queue. cron process consumes queue, performing send. note "message" here object or db record containing info sufficient perform assigned task: send message of type x sender/user y recipient/user z, etc. have audit fields current status, when item added queue, when completed, etc. maybe queue purged of completed tasks after period of time.
on upside, web processes - registration, etc - aren't waiting these messages go out, client waiting @ browser end gets snappier web response.
on downside, web process can't know sure if task performed; can know request has been passed along queue eventual processing.
still, offer web interfaces user study status of pending/completing requests , might sufficient.
just thinking out loud... ;-)
php email codeigniter
Comments
Post a Comment