Socorro/SocorroUI/Post Crash Email Staging

From MozillaWiki
Jump to: navigation, search

Please do the following steps in Socorro Stage. Stage is populated from production, so it's critical that stage is in a known state of *fake data* before testing the CrashFixedEmail feature.

All emails sent using the [Socorro/SocorroUI/Post Crash Email|Post Crash Email] admin page should be tested in a stage environment before being run in production. The following steps will show you how to prepare your stage environment for clean testing.

Details

Determine the appropriate values for product, versions, crash signature, start date and end date. Also ensure that you have the email subject and email body that will be sent to the end users.

Set all email addresses to NULL for the current range of data in the reports partitions. Keep in mind that reports tables such as reports_20100104 contain 1 week of data for reports starting on 2010.01.04 and ending on 2010.01.11. For example:

UPDATE reports_20100104 
SET email = NULL 
WHERE
product = 'Firefox' AND 
version = '3.6b5' AND 
signature = 'UserCallWinProcCheckWow';

For your list of test email addresses, update at least 1 row per email address. For example:

UPDATE reports_20100104 
SET email = 'testuser@email.com' 
WHERE uuid IN (
  SELECT uuid 
  FROM reports_20100104 
  WHERE
  product = 'Firefox' AND 
  version = '3.6b5' AND 
  signature = 'UserCallWinProcCheckWow' 
  AND email IS NULL
  LIMIT 1
);

Create a IT Request ticket to have IT run these SQL statements.

Have the email author test this email on stage. Have the author confirm that the estimated email volume *matches* the number of test email addresses before hitting send. This should be a handful of emails and not hundreds or thousands.

Tips: Using Gmail addresses it's possible to generate many _unique_ addresses

Resetting Email Campaigns

You can reuse the reports table test data, if you clear out the existing email campaigns.

DELETE FROM email_campaigns_contacts;
DELETE FROM email_contacts;
DELETE FROM email_campaigns;

The only data cached on the frontend is the email campaign information, which will require an IT bug to clear memcache. I wouldn’t do this unless you are testing the email campaign detail page and your seeing stale data. (total corner case and not worth waiting for IT bug unless you really want to do this).

Note: resetting email campaigns will invalidate any email subscription urls.