Page MenuHomePhabricator

Implement ability (in back-end) for organizers to email participants
Closed, ResolvedPublic5 Estimated Story Points

Description

As an organizer, I want to be able to email participants, so that I can ensure they are properly informed, ready, or supported at all stages of the event life cycle.

NOTE: This represents any back-end work (not dependent on UI designs) for allowing a list of participants to receive a message via the 'email this user' feature

Acceptance Criteria:

  • A selected list of participants can be sent an email by the organizer all at once via the 'email this user' feature
  • Only participants who have an email address associated with their accounts AND have checked 'All other users to email me' in Preferences should be available for email messages
  • The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").

Screen Shot 2022-08-25 at 11.49.45 AM.png (976×1 px, 435 KB)

Event Timeline

ifried renamed this task from TBD: next steps in implementation of allowing organizer to message participants to maybe after T316235, but not essential: next steps in implementation of allowing organizer to message participants.Sep 7 2022, 5:10 PM
vyuen set the point value for this task to 3.Sep 13 2022, 5:10 PM
ifried renamed this task from maybe after T316235, but not essential: next steps in implementation of allowing organizer to message participants to Implement ability (in back-end) for organizers to email participants.Sep 21 2022, 5:31 PM
ifried updated the task description. (Show Details)
ifried removed the point value for this task.
vyuen set the point value for this task to 5.Sep 28 2022, 1:51 PM
vyuen subscribed.

Note that the implementation details will be informed by findings from T318378: Investigate emailing users in the context of global accounts

@gonyeahialam Hello! What are the updated prototypes for organizer messaging participants for this epic? Note that we do not need to include filters for PII support yet? Can you add the Figma link and screenshots directly into the ticket? Thanks in advance!

Change 888239 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] bug:T317223

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

Change 898806 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] bug: T317223

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

Change 888239 abandoned by Mhorsey:

[mediawiki/extensions/CampaignEvents@master] bug:T317223

Reason:

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

This is an exciting development.
Which table can be used to identify if a participant has an email address associated with their account? Will we be logging that in campaigns tables? Or is that something best referenced on another table? If another table, I would be grateful for that table information.
And where can I learn more about the campaigns tables where this campaigns email data will be logged/stored?

Change 898806 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Implement email sending

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

Change 898806 had a related patch set uploaded (by Daimona Eaytoy; author: L10n-bot):

[mediawiki/extensions/CampaignEvents@master] Implement email sending

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

Change 898806 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Implement email sending

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

✅ A selected list of participants can be sent an email by the organizer all at once via the 'email this user' feature QA note - because this is API testing, the participant list is sent just as an array of user IDs
✅ Only participants who have an email address associated with their accounts AND have checked 'All other users to email me' in Preferences should be available for email messages
🔴 The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").


✅ Email sends through API.
{F37143950}

invert_users works correctly:
{F37143968}



A few notes on this:

🔴 For this AC:

The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").

There is no mention of exclude_user in the List the participants of an event endpoint. Does the AC need updated or does the api doc need to change?

🔴 In the API docs, if the CSRF token does not match, the API should return a 400 with The provided CSRF token does not match but right now it returns a 403 forbidden:
{F37143980}

🔴 In the API docs, if if the ID of the event does not exist, the API should return a 404 with The given ID does not correspond to an existing event registration but right now it returns a 403 forbidden:
{F37143954}

🔴 In the API docs, invert_users is listed as a required parameter, but when I omit that param, it defaults to true and sends the email instead of displaying an error that a required param invert_users is missing:

{F37143971}

🔴 In the API docs, user_ids is listed as a required parameter, but when I omit that param and also omit invert_users, it defaults to true and sends the email instead of displaying an error that a required param of user_ids is missing:

{F37143976}

Thanks @vaughnwalters

🔴 The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").

Done

🔴 For this AC:

The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").
There is no mention of exclude_user in the List the participants of an event endpoint. Does the AC need updated or does the api doc need to change?

The API doc is updated

🔴 In the API docs, if the CSRF token does not match, the API should return a 400 with The provided CSRF token does not match but right now it returns a 403 forbidden:
{F37143980}

This was a documentation error

🔴 In the API docs, if if the ID of the event does not exist, the API should return a 404 with The given ID does not correspond to an existing event registration but right now it returns a 403 forbidden:
{F37143954}

This has been fixed in T343201

🔴 In the API docs, invert_users is listed as a required parameter, but when I omit that param, it defaults to true and sends the email instead of displaying an error that a required param invert_users is missing:

This was a documentation error

🔴 In the API docs, user_ids is listed as a required parameter, but when I omit that param and also omit invert_users, it defaults to true and sends the email instead of displaying an error that a required param of user_ids is missing:

This was a documentation error

Change 944179 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Resolve issues found in QA

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

Change 944179 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Resolve issues found in QA

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

Thanks @vaughnwalters

🔴 The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").

Done

🔴 For this AC:

The new API endpoint should be documented in https://www.mediawiki.org/wiki/Extension:CampaignEvents/Api. The documentation of the "exclude_user" parameter to the "List the participants of an event" endpoint should also be updated to reflect the new parameter name ("exclude_users").
There is no mention of exclude_user in the List the participants of an event endpoint. Does the AC need updated or does the api doc need to change?

The API doc is updated

✅ this is now documented and is functioning correctly.

Screen Recording 2023-08-04 at 2.19.44 PM.gif (1×2 px, 1 MB)


🔴 In the API docs, if the CSRF token does not match, the API should return a 400 with The provided CSRF token does not match but right now it returns a 403 forbidden:
{F37143980}

This was a documentation error

✅ correctly documented now:

Screenshot 2023-08-04 at 2.23.25 PM.png (82×1 px, 17 KB)

Screenshot 2023-08-04 at 2.23.35 PM.png (494×1 px, 72 KB)


🔴 In the API docs, if if the ID of the event does not exist, the API should return a 404 with The given ID does not correspond to an existing event registration but right now it returns a 403 forbidden:
{F37143954}

This has been fixed in T343201

✅ this is fixed now:

Screenshot 2023-08-04 at 2.24.28 PM.png (1×1 px, 205 KB)


🔴 In the API docs, invert_users is listed as a required parameter, but when I omit that param, it defaults to true and sends the email instead of displaying an error that a required param invert_users is missing:

This was a documentation error

✅ Documentation is correct now

Screenshot 2023-08-04 at 2.25.20 PM.png (172×2 px, 47 KB)


🔴 In the API docs, user_ids is listed as a required parameter, but when I omit that param and also omit invert_users, it defaults to true and sends the email instead of displaying an error that a required param of user_ids is missing:

This was a documentation error

✅ Documentation is correct now

Screenshot 2023-08-04 at 2.25.57 PM.png (180×1 px, 24 KB)



one more thing here is the following response "user_is_valid_recipient": bool needs added to the List the participants of an event endpoint

one more thing here is the following response "user_is_valid_recipient": bool needs added to the List the participants of an event endpoint

{{done}}

As there is nothing user-facing to test (this ticket is for back-end work only), I'm marking this as Done.