Email Notification System Using PHP MySQL -


i working on project requires sending email notifications users. way works, users follow catergories of posts/group, whenever there new post or comment under post category/group email message notifying them snippet of post itself.

i expecting send upwards of 5000 emails daily. effective use cron job fetch users , send emails @ intervals or there better means push email while avoiding blacklisting on ip email providers.

below table structure

first table

notification id // autoincrement message // message sent users createdate // date created 

second table

user_notification id // auto increment userid // id of users notification_id // id of notification first table status // 0 or 1  

so whenever post added, insert notification in first table (notification) , fetch followers of group table (following) store userids , group ids. insert each user in second table (user_notification).

my cron job fetchs 20 records user_notification table , fetch notification message notification table. fetch user email user table.

$firstquery = $lnk->mysqli->query("select * user_notification status=0 order id asc limit 0, 20", mysqli_use_result); $secondquery = $lnk->mysqli->query("select * notification id=$notification_id", mysqli_use_result); $thirdquery = $lnk->mysqli->query("select email user_table id in($userids)", mysqli_use_result);  for($no=0;$no<counter;$no++)// loop send emails { $lnk->emailsender($subject,$emailbody,$usr_email[$no]); } 

please there better way this?

unless have specific relationship isp, extremly blacklisted, or e-mails go straight spam. difficult establish mass e-mails legitimate. can use mass mailing services api of dirty work you, mail chimp or constant contact.

so code have work, minus e-mailing bit should done via mailing service , associated api.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -