private static function _get_email_template_options($choices)
 {
     $options = array();
     // Email section
     $options['email'] = array('section' => 'email', 'id' => 'email', 'title' => '"Send To:" Email Address', 'desc' => 'The email address(es) to receive all lead notifications. Separate multiple email addresses with commas.May be used in conjuction with a duty agent (both would receive notifications).', 'type' => 'text', 'std' => $choices['admin_email'], 'class' => 'nohtml');
     $options['email_from_address'] = array('section' => 'email', 'id' => 'email_from_address', 'title' => '"Send From:" Email Address', 'desc' => 'The sender\'s email address that email notifications are mailed from.If a lead is assigned to an agent (via Duty Agent or Lead Manager), this value no longer takes effect for that lead (except for saved search updates which always use this value).', 'type' => 'text', 'std' => $choices['admin_email'], 'class' => 'nohtml');
     $options['email_from_name'] = array('section' => 'email', 'id' => 'email_from_name', 'title' => '"Send From:" Name', 'desc' => 'The sender\'s name to email notifications from. If a lead is assigned to an agent (via Duty Agent or Lead Manager), this setting no longer takes effect for that lead.', 'type' => 'text', 'std' => $choices['site_name'], 'class' => 'nohtml');
     // Email Template Options section
     $options['email_template_primary_color'] = array('section' => 'email-template-options', 'id' => 'email_template_primary_color', 'title' => 'Primary Background Color', 'desc' => 'The primary color used in the email templates', 'type' => 'text', 'std' => '#777', 'class' => 'color');
     $options['email_template_secondary_color'] = array('section' => 'email-template-options', 'id' => 'email_template_secondary_color', 'title' => 'Secondary Background Color', 'desc' => 'The secondary color used in the email templates', 'type' => 'text', 'std' => '#aaa', 'class' => 'color');
     $options['email_template_logo_image_id'] = array('section' => 'email-template-options', 'id' => 'email_template_logo_image_id', 'title' => 'Logo Image', 'type' => 'select2', 'std' => '', 'choices' => self::$_choices['images']);
     $options['email_template_banner_image_id'] = array('section' => 'email-template-options', 'id' => 'email_template_banner_image_id', 'title' => 'Banner Image', 'type' => 'select2', 'std' => '', 'choices' => self::$_choices['images']);
     // Email Templates section
     $options['email_signature'] = array('section' => 'email-templates', 'id' => 'email_signature', 'title' => 'Email Signature', 'desc' => 'Appears at the bottom of each outbound email to users and agents. Available data: %%site_name%% and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_signature());
     $options['email_title_new_registration_to_user'] = array('section' => 'email-templates', 'id' => 'email_title_new_registration_to_user', 'title' => 'New Registration, To User - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_has_realtor%%, %%user_username%%, %%site_name%%, %%site_url%%, and %%registration_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_new_registration_title_to_user());
     $options['email_template_new_registration_to_user'] = array('section' => 'email-templates', 'id' => 'email_template_new_registration_to_user', 'title' => 'New Registration, To User - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_has_realtor%%, %%user_username%%, %%user_password%%, %%site_name%%, %%site_url%%, and %%registration_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_new_registration_message_to_user());
     $options['email_title_new_registration_to_admin'] = array('section' => 'email-templates', 'id' => 'email_title_new_registration_to_admin', 'title' => 'New Registration, To Agent - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_has_realtor%%, %%user_username%%, %%site_name%%, %%site_url%%, and %%registration_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_new_registration_title_to_admin());
     $options['email_template_new_registration_to_admin'] = array('section' => 'email-templates', 'id' => 'email_template_new_registration_to_admin', 'title' => 'New Registration, To Agent - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_has_realtor%%, %%user_username%%, %%site_name%%, %%site_url%%, and %%registration_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_new_registration_message_to_admin());
     $options['email_title_property_showing_to_user'] = array('section' => 'email-templates', 'id' => 'email_title_property_showing_to_user', 'title' => 'Property Info/Showing, To User - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_appointment%%, %%user_appointment2%%, %%user_message%%, %%property_address%%, %%property_mls%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_property_showing_title_to_user());
     $options['email_template_property_showing_to_user'] = array('section' => 'email-templates', 'id' => 'email_template_property_showing_to_user', 'title' => 'Property Info/Showing, To User - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_appointment%%, %%user_appointment2%%, %%user_message%%, %%property_address%%, %%property_mls%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_property_showing_message_to_user());
     $options['email_title_property_showing_to_admin'] = array('section' => 'email-templates', 'id' => 'email_title_property_showing_to_admin', 'title' => 'Property Info/Showing, To Agent - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_appointment%%, %%user_appointment2%%, %%user_message%%, %%property_address%%, %%property_mls%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_property_showing_title_to_admin());
     $options['email_template_property_showing_to_admin'] = array('section' => 'email-templates', 'id' => 'email_template_property_showing_to_admin', 'title' => 'Property Info/Showing, To Agent - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_appointment%%, %%user_appointment2%%, %%user_message%%, %%property_address%%, %%property_mls%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_property_showing_message_to_admin());
     $options['email_title_saved_property_to_admin'] = array('section' => 'email-templates', 'id' => 'email_title_saved_property_to_admin', 'title' => 'Saved Property, To Agent - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_message%%, %%property_address%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_saved_property_title_to_admin());
     $options['email_template_saved_property_to_admin'] = array('section' => 'email-templates', 'id' => 'email_template_saved_property_to_admin', 'title' => 'Saved Property, To Agent - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%user_message%%, %%property_address%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_saved_property_message_to_admin());
     $options['email_title_saved_search_to_admin'] = array('section' => 'email-templates', 'id' => 'email_title_saved_search_to_admin', 'title' => 'Saved Search, To Agent - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%search_url%%, %%site_name%%, and %%site_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_saved_search_title_to_admin());
     $options['email_template_saved_search_to_admin'] = array('section' => 'email-templates', 'id' => 'email_template_saved_search_to_admin', 'title' => 'Saved Search, To Agent - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%search_url%%, %%site_name%%, and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_saved_search_message_to_admin());
     $options['email_title_email_friend_to_user'] = array('section' => 'email-templates', 'id' => 'email_title_email_friend_to_user', 'title' => 'Email To Friend, To Friend - Title', 'desc' => 'Available data: %%user_name%% (equals "A Friend" if user isn\'t logged in), %%user_email%% (blank if user isn\'t logged in), %%user_message%%, %%friend_name%%, %%friend_email%%, %%property_address%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_email_friend_title_to_user());
     $options['email_template_email_friend_to_user'] = array('section' => 'email-templates', 'id' => 'email_template_email_friend_to_user', 'title' => 'Email To Friend, To Friend - Body', 'desc' => 'Available data: %%user_name%% (equals "A Friend" if user isn\'t logged in), %%user_email%% (blank if user isn\'t logged in), %%user_message%%, %%friend_name%%, %%friend_email%%, %%property_address%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_email_friend_message_to_user());
     $options['email_title_email_friend_to_admin'] = array('section' => 'email-templates', 'id' => 'email_title_email_friend_to_admin', 'title' => 'Email To Friend, To Agent - Title', 'desc' => 'Available data: %%user_name%% (equals "A Friend" if user isn\'t logged in), %%user_email%% (blank if user isn\'t logged in), %%user_message%%, %%friend_name%%, %%friend_email%%, %%property_address%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_email_friend_title_to_admin());
     $options['email_template_email_friend_to_admin'] = array('section' => 'email-templates', 'id' => 'email_template_email_friend_to_admin', 'title' => 'Email To Friend, To Agent - Body', 'desc' => 'Available data: %%user_name%% (equals "A Friend" if user isn\'t logged in), %%user_email%% (blank if user isn\'t logged in), %%user_message%%, %%friend_name%%, %%friend_email%%, %%property_address%%, %%property_url%%, %%site_name%%, and %%site_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_email_friend_message_to_admin());
     $options['email_title_assigned_lead'] = array('section' => 'email-templates', 'id' => 'email_title_assigned_lead', 'title' => 'Newly Assigned Lead, To Agent - Title', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%site_name%%, %%site_url%% and %%leads_url%%', 'type' => 'text', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_assigned_lead_title());
     $options['email_template_assigned_lead'] = array('section' => 'email-templates', 'id' => 'email_template_assigned_lead', 'title' => 'Newly Assigned Lead, To Agent - Body', 'desc' => 'Available data: %%user_name%%, %%user_email%%, %%user_phone%%, %%site_name%%, %%site_url%% and %%leads_url%%', 'type' => 'editor', 'std' => DispletRetsIdxEmailTemplatesModel::get_default_assigned_lead_message());
     return $options;
 }
 private function _set_titles()
 {
     if ($this->_type === 'activity_report') {
         $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_user_activity']) ? self::$_options['email_title_user_activity'] : DispletRetsIdxEmailTemplatesModel::get_default_activity_report_title();
     } else {
         if ($this->_type === 'address_captured') {
             $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_unregistered_address']) ? self::$_options['email_title_unregistered_address'] : DispletRetsIdxEmailTemplatesModel::get_default_unregistered_address_title();
         } else {
             if ($this->_type === 'assigned_lead') {
                 $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_assigned_lead']) ? self::$_options['email_title_assigned_lead'] : DispletRetsIdxEmailTemplatesModel::get_default_assigned_lead_title();
             } else {
                 if ($this->_type === 'emailed_friend') {
                     $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_email_friend_to_admin']) ? self::$_options['email_title_email_friend_to_admin'] : DispletRetsIdxEmailTemplatesModel::get_default_email_friend_title_to_admin();
                     $this->_titles['user_or_friend'] = !empty(self::$_options['email_title_email_friend_to_user']) ? self::$_options['email_title_email_friend_to_user'] : DispletRetsIdxEmailTemplatesModel::get_default_email_friend_title_to_user();
                 } else {
                     if ($this->_type === 'registration') {
                         $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_new_registration_to_admin']) ? self::$_options['email_title_new_registration_to_admin'] : DispletRetsIdxEmailTemplatesModel::get_default_new_registration_title_to_admin();
                         $this->_titles['user_or_friend'] = !empty(self::$_options['email_title_new_registration_to_user']) ? self::$_options['email_title_new_registration_to_user'] : DispletRetsIdxEmailTemplatesModel::get_default_new_registration_title_to_user();
                     } else {
                         if ($this->_type === 'saved_property') {
                             $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_saved_property_to_admin']) ? self::$_options['email_title_saved_property_to_admin'] : DispletRetsIdxEmailTemplatesModel::get_default_saved_property_title_to_admin();
                         } else {
                             if ($this->_type === 'saved_search') {
                                 $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_saved_search_to_admin']) ? self::$_options['email_title_saved_search_to_admin'] : DispletRetsIdxEmailTemplatesModel::get_default_saved_search_title_to_admin();
                             } else {
                                 if ($this->_type === 'showing_request') {
                                     $this->_titles['admin_or_agent_or_lender'] = !empty(self::$_options['email_title_property_showing_to_admin']) ? self::$_options['email_title_property_showing_to_admin'] : DispletRetsIdxEmailTemplatesModel::get_default_property_showing_title_to_admin();
                                     $this->_titles['user_or_friend'] = !empty(self::$_options['email_title_property_showing_to_user']) ? self::$_options['email_title_property_showing_to_user'] : DispletRetsIdxEmailTemplatesModel::get_default_property_showing_title_to_user();
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }