Strategies for setting email frequency in rails

I look forward to my users adjusting the frequency of email notifications.

I would like to offer them typical options: direct email, daily and weekly digests

ยฟWhat would be the best strategy for creating this in a rails 3 application?

Thanks everyone!

+3
source share
1 answer

You may have a row column email_frequency_preferencein your table usersthat saves their preferences. Then you can find users by their preference by email:

User.find_all_by_email_frequency_preference    # :instantly | :weekly | :monthly

Event , , , . :

Event.find :created_at => start_date..Date.today

:

  • , , , .

  • , :

    start_date = Date.today.beginning_of_week
    

    , , , .

  • , :

    start_date = Date.today.beginning_of_month
    

    , , .

+5

All Articles