diff options
-rw-r--r-- | app/views/track_mailer/event_digest.rhtml | 25 | ||||
-rw-r--r-- | todo.txt | 9 |
2 files changed, 26 insertions, 8 deletions
diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index 7bbd63881..858f94516 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -11,15 +11,13 @@ if result[:model].class.to_s == "InfoRequestEvent" event = result[:model] - if not event.outgoing_message.nil? - extract = highlight_and_excerpt(event.outgoing_message.body_without_salutation, @highlight_words, 150, false) - elsif not event.incoming_message.nil? - extract = highlight_and_excerpt(event.incoming_message.get_body_for_quoting, @highlight_words, 150, false) - else - extract = highlight_and_excerpt(info_request.initial_request_text, @highlight_words, 150, false) + # Request title - only add title if we're not tracking a request. + # e.g. -- Address and opening times of Post Office branches -- + if track_thing.info_request.nil? + main_text += "-- " + event.info_request.title + " --\n" end - extract.gsub!(/\s+/, ' ') + # e.g. Julian Burgess sent a request to Royal Mail Group (15 May 2008) if event.event_type == 'response' url = main_url(incoming_message_url(event.incoming_message)) main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name @@ -34,9 +32,20 @@ raise "unknown type in event_digest " + event.event_type end main_text += " (" + simple_date(event.created_at) + ")\n" + + # Main text, wrapped, words highlighted with * and indented. + if not event.outgoing_message.nil? + extract = highlight_and_excerpt(event.outgoing_message.body_without_salutation, @highlight_words, 150, false) + elsif not event.incoming_message.nil? + extract = highlight_and_excerpt(event.incoming_message.get_body_for_quoting, @highlight_words, 150, false) + else + extract = highlight_and_excerpt(info_request.initial_request_text, @highlight_words, 150, false) + end + extract.gsub!(/\s+/, ' ') main_text += MySociety::Format.wrap_email_body('"' + extract + '"').gsub(/\n+$/, "") + "\n" - main_text += url + "\n" + # Link to the request/response + main_text += url + "\n" main_text += "\n" else raise "need to add other types to TrackMailer.event_digest" @@ -40,9 +40,18 @@ Blog posts / Wikipedia articles about this request http://reportr.net/2008/04/24/bbc-spent-6m-to-develop-the-iplayer/ Or just look at referrers as Julian says +Check that this, which was success marked late by admin (me), makes it into +RSS feed OK. +http://www.whatdotheyknow.com/request/breakdown_of_calulation_of_jsa + +Debug for search track emails +Highlight words in them, and in RSS + Later ===== +HTML in Atom feed ask Tommy about it + Check this again after a while, for dodgy states of events: s = InfoRequest.find(:all).select { |i| (not i.awaiting_description) and i.get_last_response_event_id and InfoRequestEvent.find(i.get_last_response_event_id).calculated_state != i.described_state }; s.size |