ruby on rails - How can I prevent email spam (too many instant emails on actions)? -
right time comments on post poster gets email.
what instead send email next day saying "there 14 people commented on today. check out: link"
what strategy create type of notification , bundle 1 email sent instead of 14? how queue next day? best use cron this? type of worker delayed job or i'm not sure @ how architect off of heroku please let me know. i'd appreciate it.
thank you.
i recommend having cron job runs rake task this. have attribute on each comment indicates whether 'new' comment or not, , each day when cron goes through comments mark them 'not new' (or makes sense you). write query returns 'new' comments, , doesn't loop through every comment in db , check see if 'new' or not.
check out whenever gem. haven't used it, there plenty of resources decide if it's right you.
Comments
Post a Comment