Class: Disclosure::EmailReactor

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/disclosure/email_reactor.rb

Instance Method Summary collapse

Instance Method Details

#notification(model, action, user) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/mailers/disclosure/email_reactor.rb', line 9

def notification(model, action, user)
  @model = model
  @action = action
  @user = user
  @subject = t("disclosure.email_reactor.#{model.class.name.underscore}.#{action}.subject")
  mail(
    :to => @user.email,
    :subject => @subject,
    :template_path => "disclosure/email/#{model.class.name.underscore}",
    :template_name => @action
  )
end

#react!(model, action, user) ⇒ Object



5
6
7
# File 'app/mailers/disclosure/email_reactor.rb', line 5

def react!(model, action, user)
  self.notification(model, action, user).deliver
end