Socorro/Automatic Emails

From MozillaWiki
Jump to navigation Jump to search

What

Socorro is going to automatically send an email to every user that sends us his or her email address along with a crash report. The goal is to make a "just-horrible experience less bad". Goals and scope can be found here: https://etherpad.mozilla.org/socorro-email-Q3-2012

Spec

What

Automatically send an email to every user that gives us an email address.

When

An email is sent at last an hour after we receive a crash report containing an email address.

Who

Emails are sent to all users that give us their email address, with exceptions:

  • users can unsubscribe and thus not receive emails from us anymore
  • only users with a certain product, version or release channel will receive an email (for example, only Firefox users will receive those email at first)
  • users that were sent an email recently won't receive another one (recently means in the last day/week, to be determined)

Where

Socorro will take care of:

  • getting recent crash reports with an email address
  • generating the email content from templates created by admins
  • not sending anything to users that were emailed recently
  • sending the email to our ESP
  • letting admins edit email templates

The ESP will take care of:

  • making sure the user receives the email
  • allowing the user to unsubscribe from those emails

Implementation

Use a cron job that runs every hour, dependency on reports_clean, take all new reports with an email address. Use ExactTarget's triggered emails to actually send emails.

Database

CREATE TABLE emails (
    email citext not null,
    last_sending timestamp with time zone,
    constraint emails_key primary key ( email )
);

Iterations

Iteration 1

  • sending emails
  • only sending emails for Firefox crashes
  • unit tests

Not shippable.

Iteration 2

  • unsubscribe link
  • emailing delays
  • unit tests

Shippable.

Iteration 3

  • configurable restrictions based on product, version, release channel
  • email templates
  • admin interface to edit email templates
  • unit tests

Shippable.

Development notes