Class: Whoops::NotificationMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/whoops/notification_mailer.rb

Instance Method Summary collapse

Instance Method Details

#event_notification(event_group, addresses) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/mailers/whoops/notification_mailer.rb', line 2

def event_notification(event_group, addresses)
  @event_group = event_group
  @addresses = addresses
  body = <<-BODY
#{whoops_event_group_events_url(event_group.id)}

#{event_group.service}: #{event_group.environment}: #{event_group.message}
  BODY
  mail(
    :to      => addresses.join(", "),
    :from    => Rails.application.config.whoops_sender,
    :subject => "Whoops Notification | #{event_group.service}: #{event_group.environment}: #{event_group.message}",
    :body    => body,
    :content_type => "text/plain"
  )
end