Ask A Question

Notifications

You’re not receiving notifications from this thread.

Automated email notification summary

Andreas Koutsoukos asked in General

Hi, I like to have my application to send automated emails summary to users.
Users have multiple profiles that they can make and like to notify the users by email if there is more than 5 new profiles in the app. My app is here http://www.snappaajat.fi/ so people can add them snapchat profiles and other users can view and search.

Is there some gem that do this or can Chris make some video tutorial. ;)

Reply

If you want to send these on a regular basis, cron jobs are perfect for that. You can just set it up to run weekly and notify users from a rake task. Easy to test and maintain. I did an episode on that a while back: https://gorails.com/episodes/cron-jobs-with-whenever-gem?autoplay=1

Otherwise if you want it to happen on a trigger in-app like a notification every time a new profile is created, you can just put the logic in your controller to check who should receive the notification and then send that out. This sort of thing is a good case for using a service object (just a regular ruby class that contains the logic for it).

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.