From 6a92da487c0ad774b952927991551638c61eb073 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 10 Jan 2013 14:16:03 +0100 Subject: [PATCH] fix #352 - truncate long messages so subject is truncated --- app/mailers/mailer.rb | 2 +- spec/mailers/mailer_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 1ea0dbb..6766575 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -10,7 +10,7 @@ class Mailer < ActionMailer::Base @app = notice.app mail :to => @app.notification_recipients, - :subject => "[#{@app.name}][#{@notice.environment_name}] #{@notice.message}" + :subject => "[#{@app.name}][#{@notice.environment_name}] #{@notice.message.truncate(50)}" end def deploy_notification(deploy) diff --git a/spec/mailers/mailer_spec.rb b/spec/mailers/mailer_spec.rb index f6cc4ad..fc0f87c 100644 --- a/spec/mailers/mailer_spec.rb +++ b/spec/mailers/mailer_spec.rb @@ -19,6 +19,13 @@ describe Mailer do it "should have inline css" do email.should have_body_text('