Page MenuHomePhabricator

Welcome emails: Maintenance script for periodic exports
Closed, ResolvedPublic

Description

In T303240: Welcome emails: opt-in checkbox we created a checkbox for opting-in to the mailing list. In this task we want to generate CSV exports with the emails of user accounts who checked this box.

We'll want a maintenance script that has the following features:

  • support querying by dates with --from and --to fields
  • --output-mode, default is 'text' to print to stdout (one entry per line), otherwise --output-mode=csv would create a CSV for importing in Mailchimp
  • allow outputting data on whether the user has a confirmed email or not
  • allow outputting null value for email in case the user has checked the opt-in box but doesn't have a supplied email (for QA purposes, really)
  • add the "Email Address" header per the mailchimp requirements https://mailchimp.com/help/import-contacts-mailchimp/#Import_new_contacts

Event Timeline

kostajh triaged this task as High priority.

Change 773210 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] Pilot: Maintenance script for exporting emails that opt-in to mailing list

https://gerrit.wikimedia.org/r/773210

The task description states support querying by dates with --from and --to fields, e.g. --from=2022-22-03 --to=2022-23-03 but I think that's not the format we will be supporting. Maybe we should update the task description for future context.

Change 773210 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Pilot: Maintenance script for exporting emails that opt-in to mailing list

https://gerrit.wikimedia.org/r/773210

Change 773640 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] Pilot: Update export script to add headers and more data

https://gerrit.wikimedia.org/r/773640

Change 773640 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Pilot: Update export script to add headers and more data

https://gerrit.wikimedia.org/r/773640

I think this is done, unless we make changes to the experiment/control definitions (see T305015#7836990). When we're ready, we would run this manually on eswiki and share the results using mechanism-to-be-determined.

Checked in beta cluster - the script will export users who are not in controls group and who checked the checkbox - ("mailinglist":true,"_group":"T303240_mailinglist").

If a user

  • never confirms email and the token is exires
  • never enters email
  • deletes email after entering it

the script will still export such users with empty email field, e.g.

"Email Address","Opt-in date",Group,"User ID","Is email address confirmed"
,20220511165349,T303240_mailinglist,3404,0
,20220511165650,T303240_mailinglist,3405,0
test1@server.com,20220511220200,T303240_mailinglist,3407,0