aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request.rb6
-rw-r--r--app/models/request_mailer.rb6
-rw-r--r--app/models/user.rb4
3 files changed, 8 insertions, 8 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index c12d364b6..0dec0528a 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -23,7 +23,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.182 2009-04-06 16:28:44 louise Exp $
+# $Id: info_request.rb,v 1.183 2009-04-08 07:31:07 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -148,7 +148,7 @@ public
return self.magic_email("request-")
end
def incoming_name_and_email
- return TMail::Address.encode_quoted_string(self.user.name) + " <" + self.incoming_email + ">"
+ return TMail::Address.address_from_name_and_email(self.user.name, self.incoming_email).to_s
end
# Subject lines for emails about the request
@@ -462,7 +462,7 @@ public
return self.public_body.request_email
end
def recipient_name_and_email
- return TMail::Address.encode_quoted_string(self.law_used_short + " requests at " + self.public_body.short_or_long_name) + " <" + self.recipient_email + ">"
+ return TMail::Address.address_from_name_and_email(self.law_used_short + " requests at " + self.public_body.short_or_long_name, self.recipient_email).to_s
end
# History of some things that have happened
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 2e69be363..b246abf76 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_mailer.rb,v 1.71 2009-04-08 05:29:35 francis Exp $
+# $Id: request_mailer.rb,v 1.72 2009-04-08 07:31:07 francis Exp $
class RequestMailer < ApplicationMailer
@@ -37,7 +37,7 @@ class RequestMailer < ApplicationMailer
if incoming_message_followup.nil? || !incoming_message_followup.valid_to_reply_to?
return info_request.recipient_name_and_email
else
- return incoming_message_followup.mail.from_addrs[0].full_quoted_address
+ return incoming_message_followup.mail.from_addrs[0].to_s
end
end
# Used in the preview of followup
@@ -92,7 +92,7 @@ class RequestMailer < ApplicationMailer
def stopped_responses(info_request, email)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from # we don't care about bounces, likely from spammers
- @recipients = email.from_addrs[0].full_quoted_address
+ @recipients = email.from_addrs[0].to_s
@subject = "Your response to an FOI request was not delivered"
attachment :content_type => 'message/rfc822', :body => email.body
@body = {
diff --git a/app/models/user.rb b/app/models/user.rb
index c281d7f18..4638583e2 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -23,7 +23,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user.rb,v 1.87 2009-04-07 10:32:54 louise Exp $
+# $Id: user.rb,v 1.88 2009-04-08 07:31:07 francis Exp $
require 'digest/sha1'
@@ -174,7 +174,7 @@ class User < ActiveRecord::Base
# For use in to/from in email messages
def name_and_email
- return TMail::Address.encode_quoted_string(self.name) + " <" + self.email + ">"
+ return TMail::Address.address_from_name_and_email(self.name, self.email).to_s
end
# The "internal admin" is a special user for internal use.