Skip to content

Commit 37b5bd2

Browse files
committed
Merge pull request smartinez87#12 from arturaz/master
Avoid sending emails with HUGE subjects
2 parents 7ead482 + a06dd7a commit 37b5bd2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/exception_notifier/notifier.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def exception_notification(env, exception)
5252

5353
prefix = "#{@options[:email_prefix]}#{@kontroller.controller_name}##{@kontroller.action_name}"
5454
subject = "#{prefix} (#{@exception.class}) #{@exception.message.inspect}"
55+
subject = subject.length > 120 ? subject[0...120] + "..." : subject
5556

5657
mail(:to => @options[:exception_recipients], :from => @options[:sender_address], :subject => subject) do |format|
5758
format.text { render "#{mailer_name}/exception_notification" }

0 commit comments

Comments
 (0)