Class: RrdAlertMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/rrd_alert_mailer.rb

Instance Method Summary collapse

Instance Method Details

#build(submission, subject, message, error = nil, to = Settings.rrd.alerts.recipients) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/mailers/rrd_alert_mailer.rb', line 4

def build(submission, subject, message, error = nil, to = Settings.rrd.alerts.recipients)
  @id = submission.id
  @message = message
  @error = error
  template = File.read('app/mailers/views/rrd_alert_mailer.html.erb')
  environment = "[#{Settings.vsp_environment}] " unless Settings.vsp_environment == 'production'

  mail(
    to:,
    subject:,
    body: ERB.new(template).result(binding)
  )
end