Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: ability for admin to send e-mail to signed up users #32

Open
paullj1 opened this issue Jul 13, 2017 · 2 comments
Open

Feature: ability for admin to send e-mail to signed up users #32

paullj1 opened this issue Jul 13, 2017 · 2 comments

Comments

@paullj1
Copy link
Member

paullj1 commented Jul 13, 2017

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] ".

@RCydefe
Copy link
Contributor

RCydefe commented Feb 15, 2018

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 => "[email protected]", :content_type => "multipart/mixed"

def newsletter_email(recipient, newsletter)
# these are instance variables for newsletter view
@newsletter = newsletter
@recipient = recipient
mail(:to => recipient.email, :subject => newsletter.subject)
end
end

@paullj1
Copy link
Member Author

paullj1 commented Feb 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants