Reputation: 4004
I want to send the same email to all of the users that have signed up for my app with Rails 3. How do I do this? Where does the code go? How do I call the method?
Upvotes: 1
Views: 437
Reputation: 66867
Sounds like something you would do from a custom rake task:
namespace :whatever do
desc "Send out email to all users"
task :mail => :environment do
# your code goes here
end
end
Then trigger the rake task via cron whenever you need, e.g. every night.
Upvotes: 2