BathHacked/energy-sparks

View on GitHub
app/controllers/admin/emails/alert_mailers_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
module Admin::Emails
  class AlertMailersController < AdminController
    layout 'mailer'

    def show
      @email = Email.find(params[:id])
      @email_address = @email.contact.email_address
      @school = @email.contact.school
      @unsubscribe_emails = User.where(school: @school, role: :school_admin).pluck(:email).join(', ')
      @alert_content = AlertMailer.create_content(@email.alert_subscription_events.by_priority)

      render 'alert_mailer/alert_email'
    end
  end
end