Page MenuHomePhabricator

Create a proof-of-concept for using EmailUser API instead of sending emails ourselves in The Wikipedia Library
Closed, ResolvedPublic3 Estimated Story Points

Description

Per T382314#10433215 let's try a proof of concept patch for using the EmailUser API (https://www.mediawiki.org/wiki/API:Emailuser) for sending our Library emails instead of sending them ourselves.

We do still need to retain emails in the library for now for other reasons but could ideally drop the email sending code.

This may involve creating a djmail backend.

Event Timeline

Scardenasmolinar lowered the priority of this task from Medium to Low.Jan 22 2025, 5:23 PM
Scardenasmolinar changed the task status from Open to In Progress.Jan 28 2025, 3:42 PM
Scardenasmolinar claimed this task.
Scardenasmolinar changed the task status from In Progress to Open.Feb 4 2025, 5:10 PM
Scardenasmolinar removed Scardenasmolinar as the assignee of this task.
Scardenasmolinar moved this task from Inbox to Estimated on the Moderator-Tools-Team board.
Scardenasmolinar subscribed.
Scardenasmolinar changed the task status from Open to In Progress.Aug 6 2025, 11:56 PM
Scardenasmolinar claimed this task.
Scardenasmolinar moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.
jsn.sherman subscribed.

Not waiting on patch changes necessarily, rather some investigation/decision making

I was going to file a separate data analysis ticket, but because the queries ending up seeming fairly straightforward:

Of the 35,861 English Wikipedia editors who made an edit in the last 6 months and pass the 500 edit / 6 month editing baseline, 4,310 (12%) have disabled the preference enabling them to be emailed through EmailUser. Posting the queries here for reference / in case I did anything obviously wrong:

All 'active' qualifying users

SELECT DISTINCT event_user_id FROM wmf.mediawiki_history
WHERE snapshot = '2025-07'
AND wiki_db = 'enwiki'
AND event_user_registration_timestamp < '2025-02-21'
AND event_user_revision_count > 500
AND event_timestamp > '2025-02-21'

All users with email disabled

SELECT up_user
FROM wmf_raw.mediawiki_user_properties
WHERE snapshot = '2025-07'
AND wiki_db = 'enwiki'
AND up_property = 'disablemail'
AND up_value = '1'

One question I have, because it occurs to me I might have got my wires crossed with T355547, is do we need to send users any emails in this way, or is this all about internal notifications?

One question I have, because it occurs to me I might have got my wires crossed with T355547, is do we need to send users any emails in this way, or is this all about internal notifications?

Enotif is a separate solution, so doing it this way is mutually exclusive to echo.

One question I have, because it occurs to me I might have got my wires crossed with T355547, is do we need to send users any emails in this way, or is this all about internal notifications?

Enotif is a separate solution, so doing it this way is mutually exclusive to echo.

That makes sense, but I'm more asking if this EmailUser API spike is limited to the case where we need to email @wikimedia.org, or if we might also use this approach for users.

No, this is for any wiki account that can receive email, eg. through Special:EmailUser.

@Samwalton9-WMF, if you would like to move forward for this approach, let's create a new task for it and base it on Susana's work here. Either way, can we close this out?

Closing this out makes sense.

For the next step, I'm not sure at the moment. Not being able to contact potentially 12% of our users feels problematic (though, granted, better than 100%), and I don't think we can expect them to turn that preference on just for library emails. Perhaps we could follow this route for wikipedialibrary@wikimedia.org emails, and then we could invest our time in T353476: Replace The Wikipedia Library's email functionality with a combination of platform features and Echo notifications instead?