Skip to content
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

Include sharable link in "favorite sessions" email #1056

Merged
merged 4 commits into from
May 2, 2024

Conversation

timiwahalahti
Copy link
Collaborator

The "favorite sessions" email includes the sessions the user chose, it'd be helpful to include the link, so that they can easily apply those sessions to their phone or other device, and so that they can easily get a much better view of their personalized schedule on the website.

This PR adds that link to that email.

For ease, let's get the schedule page by slug. This way we do not need to pass the page ID just for this, but we neither blindly trust the input sent to REST API as a URL that belongs to the WordCamp site.

Fixes #186

Props @iandunn

Screenshots

CleanShot 2023-09-21 at 17 09 11@2x

How to test the changes in this Pull Request:

  1. Go to WordCamp website schedule page
  2. Favorite some sessions
  3. Send the email
  4. Open the link in email, favorite sessions should be indicated

@timiwahalahti timiwahalahti added [Priority] 3 [Component] WC-Post-Types Organizers, Speakers, Sessions, Schedule, Sponsors, Volunteers labels Sep 21, 2023
@timiwahalahti
Copy link
Collaborator Author

Lint errors (phpcs) are coming from rule that I don't get.

'validate_callback' => function( $value, $request, $param ) { is way better than
'validate_callback' => function ( $value, $request, $param ) { 🤔

@pkevan
Copy link
Contributor

pkevan commented Nov 30, 2023

Lint errors (phpcs) are coming from rule that I don't get.

'validate_callback' => function( $value, $request, $param ) { is way better than 'validate_callback' => function ( $value, $request, $param ) { 🤔

For some reason PHPCS is treating the function keyword as a function declaration instead of being an anonymous function as it is in this case.

I can see two ways of this being used in the wc-post-types/inc/rest-api.php file, including one with a space, perhaps to get over this error.

@renintw renintw added [Type] Good First Issue Straightforward, self-contained, doesn't require deep knowledge of codebase [Priority] Medium [Type] Enhancement and removed [Priority] 3 labels Apr 11, 2024
Copy link
Contributor

@renintw renintw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codes look good and works as expected.

Screenshot 2024-05-02 at 17 34 23

@renintw
Copy link
Contributor

renintw commented May 2, 2024

Note: I timeboxed some time to address the issue where PHPCS was mistakenly identifying anonymous functions as declaration functions. Found that: 1. The --config-show reveals that PHPCS doesn't seem to properly read the phpcs.xml.dist file. 2. It is possible to write custom logic to avoid certain patterns being misidentified. Tried, but not working as expected. Given that it exceeded the time I had allocated for it and many other files use function (), I decided not to look into it further at the moment. Noted this for future reference.

@renintw renintw merged commit f79c65e into WordPress:production May 2, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] WC-Post-Types Organizers, Speakers, Sessions, Schedule, Sponsors, Volunteers [Priority] Medium [Type] Enhancement [Type] Good First Issue Straightforward, self-contained, doesn't require deep knowledge of codebase
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Include sharable link in "favorite sessions" email
3 participants