diff --git a/projects/plugins/crm/admin/dashboard/main.page.php b/projects/plugins/crm/admin/dashboard/main.page.php index cf0744071f368..080951c2102d3 100644 --- a/projects/plugins/crm/admin/dashboard/main.page.php +++ b/projects/plugins/crm/admin/dashboard/main.page.php @@ -256,8 +256,12 @@ function jpcrm_render_dashboard_page() { $last_x_ago = ''; foreach ( $latest_logs as $log ) { - $em = zeroBS_customerEmail( $log['owner'] ); - $avatar = zeroBSCRM_getGravatarURLfromEmail( $em, 28 ); + $log_avatar = ''; + $log_wp_user = get_userdata( $log['owner'] ); + // If the WP user still exists, grab their email and generate a gravatar URL. + if ( $log_wp_user ) { + $log_avatar = zeroBSCRM_getGravatarURLfromEmail( $log_wp_user->user_email, 28 ); + } $unixts = gmdate( 'U', strtotime( $log['created'] ) ); $diff = human_time_diff( $unixts, current_time( 'timestamp' ) ); // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested @@ -289,7 +293,13 @@ function jpcrm_render_dashboard_page() { } ?>