-
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 all 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 |
|---|---|---|
|
|
@@ -136,6 +136,21 @@ function wpum_email_tag_login_page_url( $user_id = false ) { // phpcs:ignore Gen | |
| $login_page_url = wpum_get_core_page_id( 'login' ); | ||
| $login_page_url = get_permalink( $login_page_url ); | ||
|
|
||
| return $login_page_url; | ||
| } | ||
|
|
||
| /** | ||
| * Parse the {login_page_link} tag into the email to display the site login page url as a link. | ||
| * | ||
| * @param string $user_id | ||
| * | ||
| * @return string | ||
| */ | ||
| function wpum_email_tag_login_page_link( $user_id = false ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Required by email tag callback signature. | ||
|
|
||
| $login_page_url = wpum_get_core_page_id( 'login' ); | ||
| $login_page_url = get_permalink( $login_page_url ); | ||
|
|
||
| $url = $login_page_url; | ||
|
|
||
| if ( wpum_get_option( 'email_template' ) !== 'none' ) { | ||
|
|
@@ -177,6 +192,30 @@ function wpum_email_tag_password_recovery_url( $user_id, $password_reset_key, $p | |
| 'action' => 'wpum-reset', | ||
| ), $reset_page ); | ||
|
|
||
| return $reset_page; | ||
| } | ||
|
|
||
| /** | ||
| * Parse the {recovery_link} tag into the email to display personalized password recovery url as a link. | ||
| * | ||
| * @param int $user_id | ||
| * @param string $password_reset_key | ||
| * @param string $plain_text_password | ||
| * @param string $tag | ||
| * @param string $email | ||
| * | ||
| * @return string | ||
| */ | ||
| function wpum_email_tag_password_recovery_link( $user_id, $password_reset_key, $plain_text_password, $tag, $email ) { | ||
|
||
|
|
||
| $reset_page = wpum_get_core_page_id( 'password' ); | ||
| $reset_page = get_permalink( $reset_page ); | ||
| $reset_page = add_query_arg( array( | ||
| 'login' => rawurlencode( $email->user_login ), | ||
| 'key' => $password_reset_key, | ||
| 'action' => 'wpum-reset', | ||
| ), $reset_page ); | ||
|
|
||
| $link_color = apply_filters( 'wpum_email_tag_password_recovery_url_color', '#000' ); | ||
|
|
||
| $output = $reset_page; | ||
|
|
||
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.