diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/track_mailer.rb | 2 | ||||
-rw-r--r-- | app/models/track_thing.rb | 66 |
2 files changed, 34 insertions, 34 deletions
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index f618fba49..92da7c376 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -47,7 +47,7 @@ class TrackMailer < ApplicationMailer return done_something end for user in users - next if !user.should_be_emailed? + next if !user.should_be_emailed? || !user.receive_email_alerts email_about_things = [] track_things = TrackThing.find(:all, :conditions => [ "tracking_user_id = ? and track_medium = ?", user.id, 'email_daily' ]) diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index f6a58189f..7f6bc9a7e 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -195,16 +195,16 @@ class TrackThing < ActiveRecord::Base if self.track_type == 'request_updates' @params = { # Website - :list_description => _("'{{link_to_request}}', a request", :link_to_request => "<a href=\"/request/" + CGI.escapeHTML(self.info_request.url_title) + "\">" + CGI.escapeHTML(self.info_request.title) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => _("Track this request by email"), - :verb_on_page_already => _("You are already tracking this request by email"), + :list_description => _("'{{link_to_request}}', a request", :link_to_request => "<a href=\"/request/" + CGI.escapeHTML(self.info_request.url_title) + "\">" + CGI.escapeHTML(self.info_request.title) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how + :verb_on_page => _("Follow this request"), + :verb_on_page_already => _("You are already following this request"), # Email :title_in_email => _("New updates for the request '{{request_title}}'", :request_title => self.info_request.title), :title_in_rss => _("New updates for the request '{{request_title}}'", :request_title => self.info_request.title), # Authentication - :web => _("To follow updates to the request '{{request_title}}'", :request_title => CGI.escapeHTML(self.info_request.title)), - :email => _("Then you will be emailed whenever the request '{{request_title}}' is updated.", :request_title => CGI.escapeHTML(self.info_request.title)), - :email_subject => _("Confirm you want to follow updates to the request '{{request_title}}'", :request_title => self.info_request.title), + :web => _("To follow the request '{{request_title}}'", :request_title => CGI.escapeHTML(self.info_request.title)), + :email => _("Then you will be updated whenever the request '{{request_title}}' is updated.", :request_title => CGI.escapeHTML(self.info_request.title)), + :email_subject => _("Confirm you want to follow the request '{{request_title}}'", :request_title => self.info_request.title), # RSS sorting :feed_sortby => 'newest' } @@ -212,15 +212,15 @@ class TrackThing < ActiveRecord::Base @params = { # Website :list_description => _("any <a href=\"/list\">new requests</a>"), - :verb_on_page => _("Email me when there are new requests"), - :verb_on_page_already => _("You are being emailed when there are new requests"), + :verb_on_page => _("Follow all new requests"), + :verb_on_page_already => _("You are already following new requests"), # Email :title_in_email => _("New Freedom of Information requests"), :title_in_rss => _("New Freedom of Information requests"), # Authentication - :web => _("To be emailed about any new requests"), - :email => _("Then you will be emailed whenever anyone makes a new FOI request."), - :email_subject => _("Confirm you want to be emailed about new requests"), + :web => _("To be follow new requests"), + :email => _("Then you will be following all new FOI request."), + :email_subject => _("Confirm you want to follow new requests"), # RSS sorting :feed_sortby => 'newest' } @@ -228,15 +228,15 @@ class TrackThing < ActiveRecord::Base @params = { # Website :list_description => _("any <a href=\"/list/successful\">successful requests</a>"), - :verb_on_page => _("Email me new successful responses "), - :verb_on_page_already => _("You are being emailed about any new successful responses"), + :verb_on_page => _("Follow new successful responses"), + :verb_on_page_already => _("You are following all new successful responses"), # Email :title_in_email => _("Successful Freedom of Information requests"), :title_in_rss => _("Successful Freedom of Information requests"), # Authentication - :web => _("To be emailed about any successful requests"), - :email => _("Then you will be emailed whenever an FOI request succeeds."), - :email_subject => _("Confirm you want to be emailed when an FOI request succeeds"), + :web => _("To follow all successful requests"), + :email => _("Then you will be notified whenever an FOI request succeeds."), + :email_subject => _("Confirm you want to follow all successful FOI requests"), # RSS sorting - used described date, as newest would give a # date for responses possibly days before description, so # wouldn't appear at top of list when description (known @@ -246,48 +246,48 @@ class TrackThing < ActiveRecord::Base elsif self.track_type == 'public_body_updates' @params = { # Website - :list_description => _("'{{link_to_authority}}', a public authority", :link_to_authority => "<a href=\"/body/" + CGI.escapeHTML(self.public_body.url_name) + "\">" + CGI.escapeHTML(self.public_body.name) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => _("Track requests to {{public_body_name}} by email",:public_body_name=>CGI.escapeHTML(self.public_body.name)), - :verb_on_page_already => _("You are already tracking requests to {{public_body_name}} by email", :public_body_name=>CGI.escapeHTML(self.public_body.name)), + :list_description => _("'{{link_to_authority}}', a public authority", :link_to_authority => "<a href=\"/body/" + CGI.escapeHTML(self.public_body.url_name) + "\">" + CGI.escapeHTML(self.public_body.name) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how + :verb_on_page => _("Follow requests to {{public_body_name}}",:public_body_name=>CGI.escapeHTML(self.public_body.name)), + :verb_on_page_already => _("You are already following requests to {{public_body_name}}", :public_body_name=>CGI.escapeHTML(self.public_body.name)), # Email :title_in_email => self.public_body.law_only_short + " requests to '" + self.public_body.name + "'", :title_in_rss => self.public_body.law_only_short + " requests to '" + self.public_body.name + "'", # Authentication - :web => _("To be emailed about requests made using {{site_name}} to the public authority '{{public_body_name}}'", :site_name=>MySociety::Config.get('SITE_NAME', 'Alaveteli'), :public_body_name=>CGI.escapeHTML(self.public_body.name)), - :email => _("Then you will be emailed whenever someone requests something or gets a response from '{{public_body_name}}'.", :public_body_name=>CGI.escapeHTML(self.public_body.name)), - :email_subject => _("Confirm you want to be emailed about requests to '{{public_body_name}}'", :public_body_name=>self.public_body.name), + :web => _("To follow requests made using {{site_name}} to the public authority '{{public_body_name}}'", :site_name=>MySociety::Config.get('SITE_NAME', 'Alaveteli'), :public_body_name=>CGI.escapeHTML(self.public_body.name)), + :email => _("Then you will be notified whenever someone requests something or gets a response from '{{public_body_name}}'.", :public_body_name=>CGI.escapeHTML(self.public_body.name)), + :email_subject => _("Confirm you want to follow requests to '{{public_body_name}}'", :public_body_name=>self.public_body.name), # RSS sorting :feed_sortby => 'newest' } elsif self.track_type == 'user_updates' @params = { # Website - :list_description => _("'{{link_to_user}}', a person", :link_to_user => "<a href=\"/user/" + CGI.escapeHTML(self.tracked_user.url_name) + "\">" + CGI.escapeHTML(self.tracked_user.name) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => _("Track this person by email"), - :verb_on_page_already => _("You are already tracking this person by email"), + :list_description => _("'{{link_to_user}}', a person", :link_to_user => "<a href=\"/user/" + CGI.escapeHTML(self.tracked_user.url_name) + "\">" + CGI.escapeHTML(self.tracked_user.name) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how + :verb_on_page => _("Follow this person"), + :verb_on_page_already => _("You are already following this person"), # Email :title_in_email => _("FOI requests by '{{user_name}}'", :user_name=>self.tracked_user.name), :title_in_rss => _("FOI requests by '{{user_name}}'", :user_name=>self.tracked_user.name), # Authentication - :web => _("To be emailed about requests by '{{user_name}}'", :user_name=>CGI.escapeHTML(self.tracked_user.name)), - :email => _("Then you will be emailed whenever '{{user_name}}' requests something or gets a response.", :user_name=>CGI.escapeHTML(self.tracked_user.name)), - :email_subject => _("Confirm you want to be emailed about requests by '{{user_name}}'", :user_name=>self.tracked_user.name), + :web => _("To follow requests by '{{user_name}}'", :user_name=>CGI.escapeHTML(self.tracked_user.name)), + :email => _("Then you will be notified whenever '{{user_name}}' requests something or gets a response.", :user_name=>CGI.escapeHTML(self.tracked_user.name)), + :email_subject => _("Confirm you want to follow requests by '{{user_name}}'", :user_name=>self.tracked_user.name), # RSS sorting :feed_sortby => 'newest' } elsif self.track_type == 'search_query' @params = { # Website - :list_description => "<a href=\"/search/" + CGI.escapeHTML(self.track_query) + "/newest/advanced\">" + self.track_query_description + "</a>", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => _("Track things matching this search by email"), - :verb_on_page_already => _("You are already tracking things matching this search by email"), + :list_description => "<a href=\"/search/" + CGI.escapeHTML(self.track_query) + "/newest/advanced\">" + self.track_query_description + "</a>", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how + :verb_on_page => _("Follow things matching this search"), + :verb_on_page_already => _("You are already following things matching this search"), # Email :title_in_email => _("Requests or responses matching your saved search"), :title_in_rss => _("Requests or responses matching your saved search"), # Authentication :web => _("To follow requests and responses matching your search"), - :email => _("Then you will be emailed whenever a new request or response matches your search."), - :email_subject => _("Confirm you want to be emailed about new requests or responses matching your search"), + :email => _("Then you will be notified whenever a new request or response matches your search."), + :email_subject => _("Confirm you want to follow new requests or responses matching your search"), # RSS sorting - XXX hmmm, we don't really know which to use # here for sorting. Might be a query term (e.g. 'cctv'), in # which case newest is good, or might be something like |