openoakland / disclosure-alert

Prototype of email alerts whenever campaign finance disclosures come in
https://alert.opendisclosure.io
2 stars 0 forks source link

Add ManualSend class to back-send previous time ranges #40

Closed tdooner closed 4 years ago

tdooner commented 4 years ago

Due to an error, filings between 9/13 and 9/23 didn't go out as planned. This commit adds a way to back-send the filings for this range like so:

  send = ManualSend.new(
    date_from: Date.new(2020, 9, 13),
    date_to: Date.new(2020, 9, 23),
    notice: "Due to a server error, filings submitted between 9/13 and
      9/23 were not sent out via Open Disclosure Alerts. The error has
      been fixed and future filings will be sent out normally. The below
      email contains the filings during that timeframe. We apologize for
      the error and regret the delay."
    )
  send.preview
  send.execute!