function tdr_check_entry_cap($user_id, $campaign_slug, $user_email = '')
{
    // Fetch the campaign
    $promotion = new tdr_promotions();
    $campaign_data = $promotion->get_the_decoded_promotion_by_slug($campaign_slug);
    $entry_limit = $campaign_data['entry_limit'];
    // Get campaign scoring limit
    $meta_key_map_array = array('signup' => 'signup_entries', 'sharing' => array('facebook' => 'share_facebook', 'twitter' => 'share_twitter'), 'referrals' => 'referrals');
    $current_contestant_entries = get_user_meta($user_id, 'contest_entries', true);
    // Get the contestant's entries
    // Get the multiplier values for each category and find the user's subtotals, then add them together
    $user_overall_entry_total = 0;
    foreach ($meta_key_map_array as $entry_category => $campaign_multiplier) {
        if (is_array($campaign_multiplier)) {
            foreach ($campaign_multiplier as $entry_subcategory => $campaign_submultiplier) {
                $category_total = (int) $current_contestant_entries[$entry_category][$entry_subcategory] * (int) $campaign_data[$campaign_submultiplier];
                $user_overall_entry_total += $category_total;
            }
        } else {
            $category_total = (int) $current_contestant_entries[$entry_category] * (int) $campaign_data[$campaign_multiplier];
            $user_overall_entry_total += $category_total;
        }
    }
    // Skip user if they have no entries
    if ($user_overall_entry_total >= $entry_limit) {
        // Lookup email address when not provided
        if (empty($user_email)) {
            // Get user information
            $user_info = get_userdata($user_id);
            $user_email = $user_info->{'user_email'};
        }
        $confirm_group = $campaign_data['verified_contact_group_id'];
        $maxed_entries_group = $campaign_data['capped_contact_group_id'];
        // Remove them from the verified group
        tdr_remove_from_email_group($confirm_group, $user_email);
        // Add them to the maxed entries group
        tdr_add_to_email_group($maxed_entries_group, $user_email);
    }
}