user730569
user730569

Reputation: 4004

Sending an email to all users

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

Answers (1)

Michael Kohl
Michael Kohl

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

Related Questions