Closed Bug 814647 Opened 12 years ago Closed 11 years ago

[tracker] Send an email to every user that crashes

Categories

(Socorro :: General, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: adrian, Assigned: adrian)

References

Details

(Whiteboard: [2012Q4])

We want to send an email to every user that crashes and provides an email address. Goals are defined here: https://etherpad.mozilla.org/socorro-email-Q3-2012 and the email content is to be defined in bug 780160. 

Several questions remain: 

1. When is that email sent? Right after we receive the crash report, or can it wait for a little bit (something like an hour)? 
2. How often do we send that email? If a user crashes several times in a row, or in the same day, do we send him an email each time? 
3. Who do we send this email to? Only Firefox release users? All products / versions users? Do we want to have different emails for our other products like Thunderbird? Do we want to send a different email to someone using Beta or Aurora? 

Depending on the answer to question 1, I see 2 different ways of implementing the system: 

A. Email Queue (immediate sending)
--------------

We hack the processor to make it send every crash report with an email address to a new queue, and we add a script to read that queue and send emails as soon as possible. 

Note: need to make sure we process all crashes with an email address provided, otherwise we might miss some users. 

B. Email Cronjob (postponed sending)
----------------

We add a cronjob that will take every new crash since the last time it ran, and for each with an email address sends an email. This means some users won't receive the email immediately but after a time that could be at max the delay of the cronjob (can be fixed to anything, from 5 minutes to 1 hour being the most acceptable delays to me). 

In both cases, we will need to: 
- offer a way to unsubscribe (will be done in a different bug)
- remember who we sent emails to and when, to not flood them
- have a different email content depending on the crash report?
- offer a way for admins to edit the email content?
Some off-the-cuff answers:

1. When is that email sent? Right after we receive the crash report, or can it wait for a little bit (something like an hour)? 

An hour is probably fine (although the sooner the better).

2. How often do we send that email? If a user crashes several times in a row, or in the same day, do we send him an email each time? 

I imagine just for the first time. I think each email address should get a "cooling off" period of at least several days.

3. Who do we send this email to? Only Firefox release users? All products / versions users? Do we want to have different emails for our other products like Thunderbird? Do we want to send a different email to someone using Beta or Aurora? 

For starters, Firefox users. I'd like to (eventually) be able to send different emails to different people based on what is in the crash report (using things like version, OS, add-ons and signature)
Bug 814512 tells me that this is replacing the existing (probably broken) campaign features. If that's the case, shouldn't there also be a way that we can change the email being sent to "We've fixed this, do xxxx to get the fix"? (and also send that email out to users we've already emailed...).
(In reply to Mark Banner (:standard8) from comment #2)
> Bug 814512 tells me that this is replacing the existing (probably broken)
> campaign features. If that's the case, shouldn't there also be a way that we
> can change the email being sent to "We've fixed this, do xxxx to get the
> fix"? (and also send that email out to users we've already emailed...).

We can do that manually FWIW.  

Re queueing, these emails will be injected into the queue for the ESP.  I don't know if that API is non-blocking, but I suspect we don't need anything too fancy at our end.
I created a wiki page to document this work and how I'm going to do it. :cww, :laura, could you please have a look there and tell me if it's OK? Thanks! 

Please do not hesitate to fix mistakes or add anything I missed. 

https://wiki.mozilla.org/Socorro/Automatic_Emails
Depends on: 818701
I opened the pull request containing the code of the second iteration of this project: https://github.com/mozilla/socorro/pull/1026 (iteration is: https://wiki.mozilla.org/Socorro/Automatic_Emails#Iteration_2 )
Target Milestone: --- → 35
Commits pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/9ff392dcd1ad00df4ef15cded9e180572274832e
Fixes bug 814647 - Automatically send emails to all users that crash.

https://github.com/mozilla/socorro/commit/d408f35b01e62e8d7576066c6581556f4795ce31
Fixes bug 814647 - Polished automatic emails, added an integration test for exacttarget.

https://github.com/mozilla/socorro/commit/bb7a86242bc4be9e8449298881115b15f56daf75
Fixes bug 814647 - Added a test mode to prevent unexpected email sending.

https://github.com/mozilla/socorro/commit/47f870b6e0ea57a9d6997371ab32637b55b8911a
Fixes bug 814647 - Added a test to verify an email cannot be sent twice, fixed a few issues.

https://github.com/mozilla/socorro/commit/e5a1ea3480fceb3005c5338769e8ee32e0e2b40c
Merge pull request #1026 from AdrianGaudebert/814647-email-every-user

Fixes bug 814647 - Automatically send emails to all users that crash.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Steps to QA
-----------

1. Enable dev mode of the automatic email cron job, specify an email address where all emails should be sent (this happens in the configuration of crontabber)
2. Add a few crash reports with fake email addresses.
3. Wait for the cron jobs to run (or run it manually), and verify that the right number of emails was received in the tester's inbox.
4. Add a few other crashes, with new email addresses and already existing ones (the same as is step 2).
5. Run the cron job again, and verify that the tester received as many emails as the number of _new_ email addresses in step 4 (but no email should be received for already existing email adresses from step 2).
Commits pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/cdbaf7c49474a24d32f226bfad22a1dd9701e8ec
Bug 814647 - Updated crontabber default configuration, fixed small bugs in automated emails.

https://github.com/mozilla/socorro/commit/06d69fa6c3124e319dacb049fedc4c0641306a62
Merge pull request #1058 from AdrianGaudebert/814647-email-every-user

Bug 814647 - Updated crontabber default configuration, fixed small bugs ...
Commits pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/b1f0e6f419bc13afbd6d00210fcf95365d463aa2
Bug 814647 - Fixed small issues with automatic emails, added an important unit test.

https://github.com/mozilla/socorro/commit/f8d77cdfd54e790f3771934e0058bdfec9ae2627
Merge pull request #1060 from AdrianGaudebert/814647-email-every-user

Bug 814647 - Fixed small issues with automatic emails, added an importan...
QA verified on stage per steps in comment 8. A big big thank you to Adrian for tirelessly working through the verification steps with QA as well as adding more developer facing test around this feature.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.