Skip to content

Comments email links don't make sense post-untangling #99035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsas opened this issue Jan 29, 2025 · 14 comments
Closed

Comments email links don't make sense post-untangling #99035

dsas opened this issue Jan 29, 2025 · 14 comments
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Experiment] AI labels added [Feature] Comments Comments on posts and the admin screen for managing them. [Feature Group] User Interaction & Engagement Tools and features for site owners to share, promote, and manage engagement with their audiences. [Linear] Untangling Calypso Needs triage Ticket needs to be triaged [Pri] Normal Schedule for the next available opportuinity. [Status] Auto-allocated [Type] Bug When a feature is broken and / or not performing as intended

Comments

@dsas
Copy link
Contributor

dsas commented Jan 29, 2025

Context and steps to reproduce

A customer has noted that the links in the "new comment awaiting approval" email don't work.

Under Calypso, using the Approve / Bin / Mark as spam links in the email, immediately did just that (and allowed you to interact with the comment).

With untangling, the email links go to Calypso and them immediately redirect to wp-admin's edit comment screen. You can Approve / Bin / Mark as spam, but it's a manual action after following the email links.

Email Calypso wp-admin
Image Image Image

Reproduction steps

  1. Opt yourself into the treatment group of the experiment
  2. Create a post/page on a blog you own
  3. Set the site to moderate all comments (Settings → Discussion → Comment must be manually approved)
  4. As a separate user leave a comment
  5. As the original user you will get an email, with the moderation options
  6. Click one of the links

Site owner impact

More than 60% of the total website/platform users

Severity

Minor

What other impact(s) does this issue have?

No response

If a workaround is available, please outline it here.

The email links all go to the edit comment screen where you can manually choose a status for the comment and then press update.

Platform

No response

@dsas dsas added [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Jan 29, 2025
@dsas
Copy link
Contributor Author

dsas commented Jan 29, 2025

I think the most practical thing to do here might be to change the email links so there's just one "Moderate comment" link. We'd probably have to change that for all users, inside the hold-out or not, because I imagine the email is sent in context of the commentor, and so getting the control/treatment for the email recipients might be tricky.

@github-actions github-actions bot added [Pri] Normal Schedule for the next available opportuinity. [Feature Group] User Interaction & Engagement Tools and features for site owners to share, promote, and manage engagement with their audiences. [Feature] Comments Comments on posts and the admin screen for managing them. labels Jan 29, 2025
Copy link

OpenAI suggested the following labels for this issue:

  • [Feature Group] User Interaction & Engagement: The issue relates to how users engage with comment approval links in emails.
  • [Feature] Comments: The problem directly affects the comment management feature, as the email links lead to the comment approval process.

@dsas
Copy link
Contributor Author

dsas commented Jan 29, 2025

Links:
p7DVsv-m73-p2#comment-52350 / 9346927-zd-a8c

Copy link

github-actions bot commented Jan 29, 2025

Support References

This comment is automatically generated. Please do not edit it.

  • 9346927-zen
  • 9404664-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Jan 29, 2025
@supernovia
Copy link
Contributor

📌 ACTIONS

  • Triaged

Thanks Dean; agreed that changing the email link would be easiest unless there's a way to make the links work with wp-admin.

@supernovia supernovia moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Jan 29, 2025
@mmtr mmtr self-assigned this Jan 31, 2025
@mmtr mmtr moved this from Triaged to In Progress in Automattic Prioritization: The One Board ™ Jan 31, 2025
@mmtr mmtr removed their assignment Jan 31, 2025
@mmtr mmtr moved this from In Progress to Triaged in Automattic Prioritization: The One Board ™ Jan 31, 2025
@mmtr
Copy link
Member

mmtr commented Jan 31, 2025

getting the control/treatment for the email recipients might be tricky.

It's not trivial, but not very complex since emails are sent from a simple site context, so we could do something like this in the email-overrides.php file:

$forced_assignment = get_user_option( RDV_EXPERIMENT_FORCE_ASSIGN_OPTION, $user->ID );
if ( false !== $forced_assignment ) {
  $should_link_to_wpadmin = 'treatment' === $forced_assignment;
} else {
  $should_link_to_wpadmin = 'treatment' === \ExPlat\get_user_assignment( 'calypso_post_onboarding_holdout_160125', $user );
}

if ( $should_link_to_wpadmin ) {
  html_email_set_template_var( 'approve_link', "https://{$site_slug}/wp-admin/edit-comments.php?comment_status=moderated" );
} else {
  html_email_set_template_var( 'approve_link', "https://wordpress.com/comment/{$site_slug}/{$comment->comment_ID}?action=approve" );
}

The above is based on the wpcom_is_duplicate_views_experiment_enabled function which we cannot re-use here because it only works for get_current_user_id()).

@radtechgh
Copy link

9404664-zen

@taipeicoder
Copy link
Contributor

taipeicoder commented Feb 14, 2025

I've created 173555-ghe-Automattic/wpcom basing on @mmtr's approach. There are a couple of areas for discussion that would be good to get y'all's opinions:

As @dsas asked, is it worth to keep the Calypso experience for the control group? Or we can simplify by landing everyone in wp-admin?

I'm not sure the action buttons Approve, Trash, and Mark as spam translates in the context of wp-admin, as they are accompanied by a nonce. That would leave us with two choices:

  1. Landing users in /wp-admin/edit-comments.php?comment_status=moderated, to see the list of comments waiting for approval
  2. Landing users in /wp-admin/comments?action=editcomment&c=:commentId, to edit the comment

Image

The PR uses approach 2 taking into consideration that the user might have a lot of commented waiting for moderation. Thus, for RDV treatment group users, they would only see one action button: Manage. Is there a better label for this action?

Image


Another approach would be to look into the routes:

And see if they can be updated to do the actions first and then redirect to wp-admin. I'm not sure if this is a good approach since it would mean that we are untangled to these routes.

@dsas
Copy link
Contributor Author

dsas commented Feb 14, 2025

Thus, for RDV treatment group users, they would only see one action button: Manage. Is there a better label for this action?

Maybe "Manage comment" or "Moderate comment" ?

Another approach would be to look into the routes [...] And see if they can be updated to do the actions first and then redirect to wp-admin.

@Automattic/t-rex had the same idea on Tuesday but we too harboured some doubts about it

@rcrdortiz
Copy link
Contributor

Thus, for RDV treatment group users, they would only see one action button: Manage. Is there a better label for this action?

Maybe "Manage comment" or "Moderate comment" ?

Another approach would be to look into the routes [...] And see if they can be updated to do the actions first and then redirect to wp-admin.

@Automattic/t-rex had the same idea on Tuesday but we too harboured some doubts about it

I just wanted to elaborate on what we talked about. We had discussed the possibility of having a Calypso link handle actions like deleting or approving, and then redirecting the user to the corresponding wp-admin page. The core idea is that Calypso already has the necessary context and authentication (since the user is logged in), so it can serve as a convenient proxy to perform these actions before sending the user to wp-admin. If we like this approach, we could run it by the Architecture group to see if it might be worth standardizing as a pattern across WPCom or if there are other approaches we should consider.

@dsas
Copy link
Contributor Author

dsas commented Feb 14, 2025

The core idea is that Calypso already has the necessary context and authentication (since the user is logged in),

It's not necessarily whether the user is logged-in - we can check that from wp-admin too, it's that CSRF protection works differently - wp-admin uses time-limited nonces and calypso does its own JWT-based magic (see e.g. p7H4VZ-54r-p2).

@dsas
Copy link
Contributor Author

dsas commented Feb 14, 2025

Given @taipeicoder's PR is 90% done, my inclination would be to finish and merge it, while simultaneously opening a wider discussion into a more convenient ux as @rcrdortiz mentions.

@taipeicoder
Copy link
Contributor

Given @taipeicoder's PR is 90% done, my inclination would be to finish and merge it, while simultaneously opening a wider discussion into a more convenient ux as @rcrdortiz mentions.

Sounds good, I think the PR is mostly there so feel free to commandeer and merge if it's missing some minor improvements.

@taipeicoder
Copy link
Contributor

Closing via merging 173555-ghe-Automattic/wpcom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Experiment] AI labels added [Feature] Comments Comments on posts and the admin screen for managing them. [Feature Group] User Interaction & Engagement Tools and features for site owners to share, promote, and manage engagement with their audiences. [Linear] Untangling Calypso Needs triage Ticket needs to be triaged [Pri] Normal Schedule for the next available opportuinity. [Status] Auto-allocated [Type] Bug When a feature is broken and / or not performing as intended
Development

No branches or pull requests

8 participants