Skip to content

Instantly share code, notes, and snippets.

@cryptexvinci
Created August 31, 2021 10:27
Show Gist options
  • Save cryptexvinci/7f8abfcea54e79b7ca7d27668173d655 to your computer and use it in GitHub Desktop.
Save cryptexvinci/7f8abfcea54e79b7ca7d27668173d655 to your computer and use it in GitHub Desktop.
Ultimate Member - Send Welcome Email after Role Change.
<?php
add_action( 'um_after_member_role_upgrade', 'my_um_after_member_role_upgrade', 10, 3 );
function my_um_after_member_role_upgrade( $hook_roles, $old_roles, $user_id ){
$user = get_userdata( $user_id );
UM()->mail()->send( $user->user_email, 'welcome_email' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment