Skip to content

Conversation

shinde-rahul
Copy link
Contributor

Q A
Bug fix? (use the a.b branch) 🔴
New feature/enhancement? (use the a.x branch) 🟢
Deprecations? 🔴
BC breaks? (use the c.x branch) 🔴
Automated tests included? 🟢
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #...

Description

This PR offers to use the page language as a language of the preference center page.

The following process is used to set a language for the preference center page: preferred contact locale --> user locale -> system locale.
This PR offers the correct/new: preferred contact locale --> page language -> user locale -> system locale.


📋 Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Create a contact and don't set the Preferred Locale field
  3. Create a Landing Page as a preference center. Add the {preferredchannel}, {saveprefsbutton} variables to the Landing Page.
  4. Create a segment email configured with the preference center and use the unsubscribe link.
  5. Choose the created landing page as the Preference Center Page.
  6. Send the email
  7. Open the email
  8. Click the unsubscribe link
  9. Check if the selected page language is used
  10. Set the Preferred Locale field for the contact
  11. Reload the preference center page
  12. Check if the preferred contact language is used

@shinde-rahul shinde-rahul added the feature A new feature for inclusion in minor or major releases label Dec 12, 2024
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.25%. Comparing base (86d541b) to head (1f077f2).
Report is 1 commits behind head on 6.x.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                6.x   #14370   +/-   ##
=========================================
  Coverage     64.24%   64.25%           
- Complexity    34573    34576    +3     
=========================================
  Files          2268     2268           
  Lines        103290   103294    +4     
=========================================
+ Hits          66360    66367    +7     
+ Misses        36930    36927    -3     
Files with missing lines Coverage Δ
...undles/EmailBundle/Controller/PublicController.php 58.89% <100.00%> (+0.53%) ⬆️
...undles/PageBundle/EventListener/PageSubscriber.php 83.67% <100.00%> (+0.69%) ⬆️

... and 2 files with indirect coverage changes

@shinde-rahul shinde-rahul marked this pull request as ready for review December 12, 2024 08:10
@shinde-rahul shinde-rahul added ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging landing-pages Anything related to landing pages labels Dec 12, 2024
@shinde-rahul shinde-rahul force-pushed the use-page-language-for-preferrence-center-page branch from 4f92c4f to 9710c39 Compare December 14, 2024 13:44
Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

Can you also test that the landing page locale will be used? That's the point of this PR.

@escopecz escopecz added the pending-feedback PR's and issues that are awaiting feedback from the author label Jan 20, 2025
@andersonjeccel
Copy link
Contributor

Oh, I raised an issue for a similar situation, but in Forms: #14458

Would you like to have a look?

@shinde-rahul shinde-rahul requested a review from escopecz January 23, 2025 05:23
@shinde-rahul
Copy link
Contributor Author

Can you also test that the landing page locale will be used? That's the point of this PR.

@escopecz, I have included a test with more scenarios. Please review.

@abhisekmazumdar
Copy link
Member

@shinde-rahul, let me know if you are open to making these changes part of this PR. I am also open to collaborating on this PR and adding these changes to it.

@shinde-rahul
Copy link
Contributor Author

@abhisekmazumdar, I can add you as a collaborator if you have made any progress with the solutions. You can take this ahead, or you can submit a PR against this branch, and I'll merge it.

@abhisekmazumdar
Copy link
Member

Thank you, @shinde-rahul, for providing collaboration access. I have added extractLanguagePackage method for the landing page. I believe this is now ready for review.

@RCheesley RCheesley added code-review-needed PR's that require a code review before merging pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged code-review-passed PRs which have passed code review labels Feb 18, 2025
@RCheesley
Copy link
Member

Given there's been substantial changes I've removed the RTC label and set it that we need a re-review on the code side and another user test. Hope that's ok!

];

yield 'Invalid contact locale, fallback to page locale' => [
'contactLocale' => 'fr', // Assume 'yy' is not a valid locale
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is fr an invalid contact locale? According to the line comment, shouldn't it be yy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now updated to correct data. Thanks for caching this.

@abhisekmazumdar
Copy link
Member

I understand that my approval may not count much since I have also made changes to this PR. However, I have reviewed the other changes, and they look good to me.

@shinde-rahul shinde-rahul requested a review from matbcvo February 24, 2025 08:13
@matbcvo matbcvo added code-review-passed PRs which have passed code review ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed code-review-needed PR's that require a code review before merging pending-test-confirmation PR's that require one test before they can be merged labels Feb 24, 2025
@RCheesley RCheesley merged commit 6c9247c into mautic:6.x Feb 24, 2025
17 checks passed
@RCheesley RCheesley modified the milestones: 6.0.0-beta, 6.0.0-beta2 Mar 5, 2025
@mautibot
Copy link
Contributor

mautibot commented Mar 6, 2025

This pull request has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/announcing-mautic-6-beta-now-available-for-testing/35196/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-review-passed PRs which have passed code review feature A new feature for inclusion in minor or major releases mautic-6 ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged user-testing-passed PRs which have been successfully tested by the required number of people.
Projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

9 participants