diff options
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/application_mailer.rb | 34 | ||||
-rw-r--r-- | app/mailers/contact_mailer.rb | 2 | ||||
-rw-r--r-- | app/mailers/outgoing_mailer.rb | 2 | ||||
-rw-r--r-- | app/mailers/request_mailer.rb | 4 | ||||
-rw-r--r-- | app/mailers/track_mailer.rb | 8 | ||||
-rw-r--r-- | app/mailers/user_mailer.rb | 2 |
6 files changed, 11 insertions, 41 deletions
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index e4178081f..d2230bb82 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -2,7 +2,7 @@ # Shared code between different mailers. # # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ require 'action_mailer/version' class ApplicationMailer < ActionMailer::Base @@ -26,37 +26,5 @@ class ApplicationMailer < ActionMailer::Base # Site-wide access to configuration settings include ConfigHelper - # For each multipart template (e.g. "the_template_file.text.html.erb") available, - # add the one from the view path with the highest priority as a part to the mail - def render_multipart_templates - added_content_types = {} - self.view_paths.each do |view_path| - Dir.glob("#{view_path}/#{mailer_name}/#{@template}.*").each do |path| - template = view_path["#{mailer_name}/#{File.basename(path)}"] - - # Skip unless template has a multipart format - next unless template && template.multipart? - next if added_content_types[template.content_type] == true - @parts << Part.new( - :content_type => template.content_type, - :disposition => "inline", - :charset => charset, - :body => render_message(template, @body) - ) - added_content_types[template.content_type] = true - end - end - end - - # Look for the current template in each element of view_paths in order, - # return the first - def find_template - self.view_paths.each do |view_path| - if template = view_path["#{mailer_name}/#{@template}"] - return template - end - end - return nil - end end diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 383f1a6e6..4dc49bf8b 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -2,7 +2,7 @@ # Sends contact form mails. # # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ class ContactMailer < ApplicationMailer # Send message to administrator diff --git a/app/mailers/outgoing_mailer.rb b/app/mailers/outgoing_mailer.rb index c602359de..083c05a7c 100644 --- a/app/mailers/outgoing_mailer.rb +++ b/app/mailers/outgoing_mailer.rb @@ -2,7 +2,7 @@ # Emails which go to public bodies on behalf of users. # # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ # Note: The layout for this wraps messages by lines rather than (blank line # separated) paragraphs, as is the convention for all the other mailers. This diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index 6102bd9d2..4dbce6738 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -2,9 +2,7 @@ # Alerts relating to requests. # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ - -require 'alaveteli_file_types' +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ class RequestMailer < ApplicationMailer # Used when an FOI officer uploads a response from their web browser - this is diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb index ea5489726..1bd8a7e23 100644 --- a/app/mailers/track_mailer.rb +++ b/app/mailers/track_mailer.rb @@ -2,7 +2,7 @@ # Emails which go to users who are tracking things. # # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ class TrackMailer < ApplicationMailer def event_digest(user, email_about_things) @@ -67,7 +67,11 @@ class TrackMailer < ApplicationMailer # Query for things in this track. We use described_at for the # ordering, so we catch anything new (before described), or # anything whose new status has been described. - xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 100, 1) + xapian_object = ActsAsXapian::Search.new([InfoRequestEvent], track_thing.track_query, + :sort_by_prefix => 'described_at', + :sort_by_ascending => true, + :collapse_by_prefix => nil, + :limit => 100) # Go through looking for unalerted things alert_results = [] for result in xapian_object.results diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index d9d15ec68..a351147f9 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -2,7 +2,7 @@ # Emails relating to user accounts. e.g. Confirming a new account # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ class UserMailer < ApplicationMailer def confirm_login(user, reasons, url) |