controller by POST from form with inputs for 'subject' and 'message' 
(message is the body)
  def mail_to_confirmed_users0 @message=params[:message] 
subject=params[:subject] User.where("confirmed_at is not null").each do 
|user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: 
subject, message: @message).deliver_now end end 
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end



-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to