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

[#139] Ensure all emails send same message #177

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

matthewhilton
Copy link
Contributor

@matthewhilton matthewhilton commented Aug 13, 2024

Closes #139

Changes:

  • Ensures that regardless if you send ical, text, or both the contents of the email received is the same. Previously, the ical email would send the plaintext as html leading to clients showing everything on a single line.
  • This is done by only passing in text to the email_to_user function, and allowing it to convert it to the appropriate html. This fixes a lot of the missing newline issues.

Note: This PR does not attempt to cleanup / fix formatting issues in email. It purely attempts to ensure that the emails sent (ical or not) are the same and fix the newline issue. Fixing email formatting is covered by #176

Testing

  • Covered by new unit tests (previously were no email related unit tests)

Manual testing:

Email Before After
Confirmation iCal image image
Cancellation image image

To Do:

@matthewhilton matthewhilton marked this pull request as ready for review August 19, 2024 04:22
@matthewhilton matthewhilton force-pushed the fix-email-inconsistency branch 2 times, most recently from bb9483a to bddf9d0 Compare August 19, 2024 04:28
Copy link
Contributor

@keevan keevan left a comment

Choose a reason for hiding this comment

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

The function str_contains() is not present in PHP version 7.4 or earlier
(PHPCompatibility.FunctionUse.NewFunctions.str_containsFound)

I checked and 4.1 has a min version of php 7.4, whereas Moodle 4.0 has a min version of php 7.3, so str_contains might not be a compatible function for this branch.

Similarly for ??=

The null coalesce equal operator (??=) is not present in PHP version 7.3 or earlier
(PHPCompatibility.Operators.NewOperators.t_coalesce_equalFound)

and the fn keyword

The "fn" keyword for arrow functions is not present in PHP version 7.3 or earlier
(PHPCompatibility.Keywords.NewKeywords.t_fnFound)

Kind of annoying, and this wouldn't have been an issue for a MOODLE_401_STABLE branch.

Otherwise, tests look good, changes look good.

@danmarsden
Copy link
Member

Just create a 4.1 branch, we don't officially support 4.0 now anyway.

@matthewhilton
Copy link
Contributor Author

Thanks @keevan good pickups, i've added the php version compatibility checker to my tooling now as well.

Deciding between forking a new branch and fixing up the issues, I decided to just fix up the issues manually since they were tiny and easy to tweak. Making a whole new branch seems unnecessary to me in this case.

@matthewhilton matthewhilton merged commit 6d18731 into MOODLE_400_STABLE Aug 23, 2024
15 checks passed
@matthewhilton matthewhilton deleted the fix-email-inconsistency branch August 23, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants