system_mailer.rb 407B

1234567891011121314
  1. class SystemMailer < ActionMailer::Base
  2. default :from => ENV['EMAIL_FROM_ADDRESS'].presence || 'you@example.com'
  3. def send_message(options)
  4. @groups = options[:groups]
  5. @headline = options[:headline]
  6. @body = options[:body]
  7. mail_options = { to: options[:to], subject: options[:subject] }
  8. mail_options[:from] = options[:from] if options[:from].present?
  9. mail(mail_options)
  10. end
  11. end