//disable the email entirely
                    $msg[$email_type]['subject'] = $msg[$user]['body'] = '';
                }
            }
        }
        return $msg;
    }
    public static function gateway_admin_emails($emails, $EM_Booking)
    {
        if (empty($EM_Booking->booking_meta['gateway']) || $EM_Booking->get_price() == 0) {
            return $emails;
        }
        $gateway = $EM_Booking->booking_meta['gateway'];
        $EM_Gateway = EM_Gateways::get_gateway($gateway);
        $admin_emails_array = self::get_gateway_admin_emails($EM_Gateway);
        $admin_emails = array();
        if (get_class($EM_Booking) == 'EM_Booking') {
            if (!empty($admin_emails_array[$gateway])) {
                $admin_emails = explode(',', $admin_emails_array[$gateway]);
            }
        } elseif (get_class($EM_Booking) == 'EM_Multiple_Booking') {
            //if MB mode is on, we check the mb email templates instead
            if (!empty($admin_emails_array[$gateway . '-mb'])) {
                $admin_emails = explode(',', $admin_emails_array[$gateway . '-mb']);
            }
        }
        return array_merge($emails, $admin_emails);
    }
}
EM_Custom_Emails::init();
 public static function event_meta_box()
 {
     global $EM_Event;
     //get custom email values if they exist
     $custom_email_values = EM_Custom_Emails::get_event_emails($EM_Event);
     $custom_admin_emails = false;
     if (get_option('dbem_custom_emails_events_admins')) {
         $custom_admin_emails = EM_Custom_Emails::get_event_admin_emails($EM_Event);
     }
     if (get_option('dbem_multiple_bookings')) {
         //warn users that these emails only apply when resending emails in multipl bookings mode
         echo '<p class="em-event-custom-emails-multiple-bookings-warning" style="font-style:italic; font-weight:bold;">';
         echo sprintf(esc_html__('Since %s is enabled, these emails will only be sent when individual bookings are modified afterwards, such as changing the status of the booking individually or resending an email.', 'em-pro'), esc_html__('Multiple Bookings Mode', 'em-pro'));
         echo '</p>';
     }
     echo '<p>' . sprintf(__('Below you can modify the emails that are sent when bookings are made. This will override the default emails located in your %s settings page.', 'em-pro'), '<a href="' . admin_url('edit.php?post_type=event&page=events-manager-options#emails:booking-emails') . '">' . esc_html__emp('Booking Email Templates', 'dbem') . '</a>');
     if (get_option('dbem_custom_emails_gateways')) {
         echo '<p>' . sprintf(__('You can also create default emails for specific gateways in your individual %s settings page.', 'em-pro'), '<a href="' . admin_url('edit.php?post_type=event&page=events-manager-gateways') . '">' . __('Gateway Settings', 'em-pro') . '</a>');
     }
     echo "<p>" . __('Click on the title texts with a plus (+) next to them to reveal further options, and the minus (-) sign to hide them.', 'em-pro') . "</p>";
     self::emails_editor($custom_email_values, array(), $custom_admin_emails);
 }