Skip to content

Instantly share code, notes, and snippets.

@sareiodata
Last active December 20, 2015 08:58
Show Gist options
  • Save sareiodata/6103807 to your computer and use it in GitHub Desktop.
Save sareiodata/6103807 to your computer and use it in GitHub Desktop.
Custom Profile Builder reset password email plugin.
<?php
/*
Plugin Name: Cozmoslabs.com Custom Password Email
Plugin URI: http://www.cozmoslabs.com
Description: Just a simple to modify plugin for a custom email when users request a password reset.
Version: 1.0
Author: Cristian Antohe
Author URI: http://www.cozmoslabs.com
*/
add_filter ("wppb_recover_password_message_content_sent_to_user1", "cpe_recover_password_message",10 , 3);
function cpe_recover_password_message($content, $requestedUserID, $requestedUserLogin) {
// Change the url to this image. Make sure you put the full path to it.
$recover_header = '<p><img src="http://www.cozmoslabs.com/wp-content/themes/darksky/images/logo.png" alt="Logo"/> </p>';
$recover_password_message = "<p>Someone requested that the password be reset for the following account: <b>$requestedUserLogin</b></p>";
$recover_password_message .= "<p>If this was a mistake, just ignore this email and nothing will happen.</p>";
$recover_password_message .= "<p>To reset your password, visit the following link:" . cpe_recover_password_link( $requestedUserLogin) . '</p>';
// Change the url to this image. Make sure you put the full path to it.
$recover_footer = '<p><img src="http://www.cozmoslabs.com/wp-content/themes/darksky/images/logo.png" alt="Footer Image"/></p>';
return $recover_header . $recover_password_message . $recover_footer;
}
function cpe_recover_password_link( $requestedUserLogin ){
$key = wppb_retrieve_activation_key( $requestedUserLogin );
return '<a href="'.add_query_arg( array( 'loginName' => $requestedUserLogin, 'key' => $key ), wppb_curpageurl() ).'">'.add_query_arg( array( 'loginName' => $requestedUserLogin, 'key' => $key ), wppb_curpageurl() ).'</a>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment