Hi Craig,
If you want to modify the email sent by s2Member when an existing user is being upgraded/downgraded, take a look at this:
viewtopic.php?f=4&t=10368&p=33365&hilit=basic+transactional#p33365If you want to send an email when you manually change the user role, you'll need to modify the behavior of WordPress by adding a function like the following to your theme's
functions.php file:
- Code: Select all
function user_role_update( $user_id, $new_role ) {
$site_url = get_bloginfo('wpurl');
$user_info = get_userdata( $user_id );
$to = $user_info->user_email;
$subject = "Role changed: ".$site_url."";
$message = "Hello " .$user_info->display_name . " your role has changed on ".$site_url.", congratulations you are now an " . $new_role;
wp_mail($to, $subject, $message);
}
add_action( 'set_user_role', 'user_role_update', 10, 2);
If you only want to send an email when changing the user role to "Free Subscriber", you'll need to adjust the function code to check
$new_role and only proceed with sending the email if it equals "subscriber".