All threads / Automated email notification summary

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. ;)

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).

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.