7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/mailers/error_radar/error_mailer.rb', line 7
def new_error(error_log, event = :recurring)
@error = error_log
@event = event
@spike_data = error_log.instance_variable_get(:@spike_data)
@url = build_url
@app_name = ErrorRadar::Notifier.app_name
subject = case event
when :spike
"[#{@app_name}] SPIKE #{@error.error_class}: #{@spike_data[:count]} hits in #{@spike_data[:window_minutes]} min"
when :new_error
"[#{@app_name}] New #{@error.severity}: #{@error.error_class}"
else
"[#{@app_name}] #{@error.severity.capitalize}: #{@error.error_class}"
end
mail(
to: ErrorRadar.config.email_recipients,
from: ErrorRadar.config.email_from || 'noreply@localhost',
subject: subject
)
end
|