Ultimate member email user when profil is visited
-
Hi, I’m desperate to email the user when their profile is visited.
The only code track I found is the following but I can’t manage to adapt itfunction um_custom_email_notifications( $notifications ){ $notifications['ninja_new_user_logged_in'] = array( 'key' => 'ninja_new_user_logged_in', 'title' => __( 'Ninja - New user has logged in','um-groups' ), 'subject' => '{site_name} - Someone logged-in to your site', 'body' => 'Hi,<br /><br />'. '"{display_name}" has access to your site right now.<br /><br />'. 'To view profile, please click the following link: {user_profile_url}', 'description' => __('Whether to send the user an email when someone login to the site.','ultimate-member'), 'recipient' => 'admin', 'default_active' => true ); return $notifications; } add_filter( 'um_email_notifications', 'um_custom_email_notifications', 10, 1 );
add_action("wp_login","um_notify_when_someone_logged_in",10, 2); function um_notify_when_someone_logged_in( $user_login, $user ){ $user_id = $user->ID; um_fetch_user( $user_id ); $recipient = "[email protected]"; $profile_name = um_user("display_name"); $profile_url = um_user_profile_url( $user_id ); UM()->mail()->send( $recipient, 'ninja_new_user_logged_in', array( 'plain_text' => 1, 'tags' => array( '{profile_name}', '{profile_url}', ), 'tags_replace' => array( $profile_name, $profile_url, ) ) ); }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Ultimate member email user when profil is visited’ is closed to new replies.