Skip to content

Manually adding responses

Liz Conlan edited this page Jan 8, 2018 · 3 revisions

What to do when there's been a genuine response that Alaveteli can't parse, but something else (Outlook, Apple Mail, some specific tool) can?

The gist is to use the FOI officer upload URL to upload the files, set the cached body of the incoming message to empty, and then add an annotation to explain what's happened.

  • First, clear out the message:
# Find the event that's causing a problem
event = InfoRequestEvent.find(2304158)

# Find its related message
message = event.incoming_message

# Set the caches to empty
message.cached_main_body_text_folded = ''
message.cached_main_body_text_unfolded = ''
message.cached_attachment_text_clipped = ''


# Copy details from the raw email (for example...)
message.subject = 'FOI - 109249 - Jen Dalestone - response'
message.mail_from_domain = 'justice.gsi.gov.uk'
message.sent_at = Time.parse('Mon, 20 Mar 2017 16:37:05 +0000')

# We just "parsed" the email, so…
message.last_parsed = Time.zone.now

message.save
  • Generate the FOI Officer upload URL from Generate foi officer upload URL from https://www.whatdotheyknow.com/admin/raw_emails/RAW_EMAIL_ID.

  • Navigate to the FOI Officer upload URL in a private browsing window (you shouldn't be logged in).

  • Add the contents of the original message and upload the extracted attachments.

  • Add an annotation explaining what you've done from your normal admin account.

Clone this wiki locally