Custom Forgot Email Template Filter Function
-
Hi there,
I may have mentioned this before, but I’ll mention it again, this is a great plugin!
I would like to customize the ‘forgot password’ email that gets sent out by this plugin. I have found this StackExchange link: Customizing lost password email
and specifically this code:<?php add_filter('retrieve_password_message', 'wpse103299_reset_msg', 10, 2); function wpse103299_reset_msg($message, $reset_key) { // the $message below is taken exactly from wp-login.php $message = __('Someone has requested a password reset for the following account:') . "\r\n\r\n"; $message .= network_home_url( '/' ) . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; $message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; return $message; }
When I drop that code in my functions.php, I do see that I can manipulate the template successfully. However, the
$key
and$user_login
apparently aren’t going through… the email that comes through shows these as empty.I’m guessing this is because I need to hook into the email form field in my LWA modal, but I’m unsure how to accomplish this. Could you please provide any insights?
Thanks in advance!
- The topic ‘Custom Forgot Email Template Filter Function’ is closed to new replies.