Open paullj1 opened 7 years ago
Here is a starting point that i found for this feature.
def send @newsletter = Newsletter.find(:params['id']) @recipients = Recipient.all @recipients.each do |recipient| Newsletter.newsletter_email(recipient, @newsletter).deliver end end
class Newsletter < ActionMailer::Base default :from => "my_email@example.com", :content_type => "multipart/mixed"
def newsletter_email(recipient, newsletter)
@newsletter = newsletter
@recipient = recipient
mail(:to => recipient.email, :subject => newsletter.subject)
end end
Yup! Logic isn't that difficult. It's more going to be implementing the view in the admin interface and creating the model to support it.
Should have a form in the settings page that allows the admin to send an e-mail to all active users. Form should have two text areas:
Subject: Message:
E-mail should prepend the subject with "[competition_name] ".