So, currently I can get the plugin to email me when users updated their information, however I was wondering. Is there a way to show what their information was before they saved the S2Memeber form and what it is after?
Currenty I have written
add_action ('ws_plugin__s2member_during_handle_profile_modifications', 'email_profile_changes');
function email_profile_changes($vars = array()) {
$user = new WP_User($vars['user_id']);
add_filter('wp_mail_content_type', 'wpdocs_set_html_mail_content_type');
$to = "test@test.co.uk";
$subject = "Profile Update - $user->user_login";
$body = "This user has updated their CMM profile information, here is their new profile data for audit purposes: <br/>" .
"<hr>" .
"First Name: " . $user->first_name . "<br/>" .
"<hr>" .
"Last Name: " . $user->last_name . "<br/>" .
"<hr>" .
"Email Address: " . $user->email_address . "<br/>" .
"<hr>" .
"Address: " . $user->wp_s2member_custom_fields['company_address'] . "<br/>" .
"<hr>" .
"Telephone Number: " . $user->wp_s2member_custom_fields['telephone_number'] . "<br/>" .
"<hr>" .
"Old User Data" . print_r($olduserdata);
wp_mail ($to, $subject, $body);
remove_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
}
How do I edit this to show what the old user information was before it was updated?