4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/mailers/solid_errors/error_mailer.rb', line 4
def error_occurred(occurrence)
unless defined?(ActionMailer::Base)
raise "ActionMailer is not available. Make sure that you require \"action_mailer/railtie\" in application.rb"
end
@occurrence = occurrence
@error = occurrence.error
subject = "#{@error.severity_emoji} #{@error.exception_class}"
if SolidErrors.email_subject_prefix.present?
subject = [SolidErrors.email_subject_prefix, subject].join(" ").squish!
end
mail(
subject: subject,
from: SolidErrors.email_from,
to: SolidErrors.email_to
)
end
|