aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/request_mailer.rb20
-rw-r--r--spec/models/request_mailer_spec.rb2
2 files changed, 11 insertions, 11 deletions
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index f07e3c3d8..116a9fe81 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -44,17 +44,17 @@ class RequestMailer < ApplicationMailer
# Incoming message arrived for a request, but new responses have been stopped.
def stopped_responses(info_request, email, raw_email_data)
- @from = contact_from_name_and_email
- headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # we don't care about bounces, likely from spammers
+ headers 'Return-Path' => blackhole_email, # we don't care about bounces, likely from spammers
'Auto-Submitted' => 'auto-replied' # http://tools.ietf.org/html/rfc3834
- @recipients = email.from_addrs[0].to_s
- @subject = _("Your response to an FOI request was not delivered")
- attachment :content_type => 'message/rfc822', :body => raw_email_data,
- :filename => "original.eml", :transfer_encoding => '7bit', :content_disposition => 'inline'
- @body = {
- :info_request => info_request,
- :contact_email => Configuration::contact_email
- }
+
+ attachments.inline["original.eml"] = raw_email_data
+
+ @info_request = info_request
+ @contact_email = Configuration::contact_email
+
+ mail(:from => contact_from_name_and_email, :to => email.from_addrs[0].to_s,
+ :reply_to => contact_from_name_and_email,
+ :subject => _("Your response to an FOI request was not delivered"))
end
# An FOI response is outside the scope of the system, and needs admin attention
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb
index 5edc8edb6..f7eaa58f8 100644
--- a/spec/models/request_mailer_spec.rb
+++ b/spec/models/request_mailer_spec.rb
@@ -98,7 +98,7 @@ describe RequestMailer, " when receiving incoming mail" do
mail.multipart?.should == true
mail.parts.size.should == 2
message_part = mail.parts[0].to_s
- bounced_mail = MailHandler.mail_from_raw_email(mail.parts[1].body)
+ bounced_mail = MailHandler.mail_from_raw_email(mail.parts[1].body.to_s)
bounced_mail.to.should == [ ir.incoming_email ]
bounced_mail.from.should == [ 'geraldinequango@localhost' ]
bounced_mail.body.include?("That's so totally a rubbish question").should be_true