-
Notifications
You must be signed in to change notification settings - Fork 21
Fix: More email merge tags and html in email templates #415
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
base: develop
Are you sure you want to change the base?
Changes from 4 commits
03a3e0d
471ed62
96fedaa
a4af1e5
585fa5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -402,12 +402,24 @@ public function get_tags() { | |||||
| 'tag' => 'login_page_url', | ||||||
| 'function' => 'wpum_email_tag_login_page_url', | ||||||
| ), | ||||||
| array( | ||||||
| 'name' => esc_html__( 'Login page link', 'wp-user-manager' ), | ||||||
| 'description' => esc_html__( 'Display the login page url.', 'wp-user-manager' ), | ||||||
| 'tag' => 'login_page_link', | ||||||
| 'function' => 'wpum_email_tag_login_page_link', | ||||||
| ), | ||||||
| array( | ||||||
| 'name' => esc_html__( 'Password recovery url', 'wp-user-manager' ), | ||||||
| 'description' => esc_html__( 'Display the password recovery url.', 'wp-user-manager' ), | ||||||
| 'tag' => 'recovery_url', | ||||||
| 'function' => 'wpum_email_tag_password_recovery_url', | ||||||
| ), | ||||||
| array( | ||||||
| 'name' => esc_html__( 'Password recovery link', 'wp-user-manager' ), | ||||||
| 'description' => esc_html__( 'Display the password recovery link.', 'wp-user-manager' ), | ||||||
|
||||||
| 'description' => esc_html__( 'Display the password recovery link.', 'wp-user-manager' ), | |
| 'description' => esc_html__( 'Display the password recovery url as a link.', 'wp-user-manager' ), |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to issue #309, the client requested adding both URL and link tags for verification as well: {verification_url} and {verification_link}. This PR only implements the login_page and recovery tags but is missing the verification tags. The issue states: "I would like to make links look like buttons... {verification_url} - Display the verification url. {verification_link} - Display a link to the verification page." Consider implementing these missing tags to fully address the issue.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -125,7 +125,7 @@ | |||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Parse the {login_page_url} tag into the email to display the site login page url. | ||||||
| * Parse the {login_page_link} tag into the email to display the site login page url. | ||||||
|
||||||
| * Parse the {login_page_link} tag into the email to display the site login page url. | |
| * Parse the {login_page_url} tag into the email to display the site login page url. |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment incorrectly states this function parses the {login_page_url} tag, but this function is actually for {login_page_link} tag (which returns an HTML anchor tag). The {login_page_url} tag is handled by wpum_email_tag_login_page_url function above. Update the docstring to say "Parse the {login_page_link} tag".
| * Parse the {login_page_url} tag into the email to display the site login page url. | |
| * Parse the {login_page_link} tag into the email to display the site login page url. |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing test coverage for the new wpum_email_tag_login_page_link function. The existing test file tests the wpum_email_tag_login_page_url function at line 59-76, but there's no corresponding test for the new login_page_link tag function. Consider adding a test to verify that this function returns an HTML anchor tag when email_template is not 'none', and a plain URL otherwise.
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing phpcs:ignore comment for unused $user_id parameter. Other similar functions in this file (wpum_email_tag_login_page_url, wpum_email_tag_sitename, wpum_email_tag_website) include the comment "// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Required by email tag callback signature." to suppress the warning for unused parameters that are required by the callback signature.
| function wpum_email_tag_login_page_link( $user_id = false ) { | |
| function wpum_email_tag_login_page_link( $user_id = false ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Required by email tag callback signature. |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment incorrectly states this function parses the {recovery_link} tag, but this function is actually for {recovery_url} tag (which returns a plain URL). The {recovery_link} tag is handled by wpum_email_tag_password_recovery_link function below. Update the docstring to say "Parse the {recovery_url} tag".
| * Parse the {recovery_link} tag into the email to display personalized password recovery url. | |
| * Parse the {recovery_url} tag into the email to display personalized password recovery url. |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment incorrectly states this function parses the {recovery_url} tag, but this function is actually for {recovery_link} tag (which returns an HTML anchor tag). The {recovery_url} tag is handled by wpum_email_tag_password_recovery_url function above. Update the docstring to say "Parse the {recovery_link} tag".
| * Parse the {recovery_url} tag into the email to display personalized password recovery url. | |
| * Parse the {recovery_link} tag into the email to display personalized password recovery url. |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing test coverage for the new wpum_email_tag_password_recovery_link function. While there is test coverage for other email tag functions in EmailTagsTest.php, there's no test for this new recovery_link tag function. Consider adding a test to verify that this function returns an HTML anchor tag when email_template is not 'none', and a plain URL otherwise, with the correct query parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description says "Display the login page url" but this should say "Display the login page link" to differentiate it from the {login_page_url} tag. The {login_page_link} tag returns an HTML anchor tag, while {login_page_url} returns just the plain URL.