is_premium() && ! ES()->trial->is_trial_valid() ) { $options['ig_es_allow_tracking'] = isset( $options['ig_es_allow_tracking'] ) ? $options['ig_es_allow_tracking'] : 'no'; } $options['ig_es_powered_by'] = isset( $options['ig_es_powered_by'] ) ? $options['ig_es_powered_by'] : 'no'; // End-IG-Code. $text_fields_to_sanitize = array( 'ig_es_from_name', 'ig_es_admin_emails', 'ig_es_email_type', 'ig_es_optin_type', 'ig_es_post_image_size', 'ig_es_track_email_opens', 'ig_es_enable_ajax_form_submission', 'ig_es_enable_welcome_email', 'ig_es_welcome_email_subject', 'ig_es_confirmation_mail_subject', 'ig_es_notify_admin', 'ig_es_admin_new_contact_email_subject', 'ig_es_enable_cron_admin_email', 'ig_es_cron_admin_email_subject', 'ig_es_cronurl', 'ig_es_hourly_email_send_limit', 'ig_es_disable_wp_cron', 'ig_es_allow_api', ); $textarea_fields_to_sanitize = array( 'ig_es_unsubscribe_link_content', 'ig_es_subscription_success_message', 'ig_es_subscription_error_messsage', 'ig_es_unsubscribe_success_message', 'ig_es_unsubscribe_error_message', 'ig_es_welcome_email_content', 'ig_es_confirmation_mail_content', 'ig_es_admin_new_contact_email_content', 'ig_es_cron_admin_email', 'ig_es_blocked_domains', 'ig_es_form_submission_success_message', ); $email_fields_to_sanitize = array( 'ig_es_from_email', ); foreach ( $options as $key => $value ) { if ( substr( $key, 0, 6 ) === 'ig_es_' ) { $value = stripslashes_deep( $value ); if ( in_array( $key, $text_fields_to_sanitize, true ) ) { $value = sanitize_text_field( $value ); } elseif ( in_array( $key, $textarea_fields_to_sanitize, true ) ) { $value = wp_kses_post( $value ); } elseif ( in_array( $key, $email_fields_to_sanitize, true ) ) { $value = sanitize_email( $value ); } update_option( $key, wp_unslash( $value ), false ); } } do_action( 'ig_es_after_settings_save', $options ); $message = __( 'Settings saved successfully!' ); $status = 'success'; ES_Common::show_message( $message, $status ); } } $allowedtags = ig_es_allowed_html_tags_in_esc(); ?>


array( 'icon' => '', 'name' => __( 'General', 'email-subscribers' ), ), 'email_sending' => array( 'icon' => '', 'name' => __( 'Email Sending', 'email-subscribers' ), ), 'security_settings' => array( 'icon' => '', 'name' => __( 'Security', 'email-subscribers' ), ), ); if ( ES_Common::is_rest_api_supported() ) { $es_settings_tabs['rest_api_settings'] = array( 'icon' => ' ', 'name' => __( 'API', 'email-subscribers' ), ); } $es_settings_tabs = apply_filters( 'ig_es_settings_tabs', $es_settings_tabs ); ?>
$value ) { ?>
render_settings_fields( $value ); ?>
' . __( 'Your emails might land in spam if you use above email address..', 'email-subscribers' ); $site_url = site_url(); $site_domain = ES_Common::get_domain_from_url( $site_url ); /* translators: %s: Site domain */ $from_email_notice .= '
' . sprintf( __( 'Consider using email address matching your site domain like %s', 'email-subscribers' ), 'info@' . $site_domain ) . ''; return $from_email_notice; } public static function get_registered_settings() { $from_email_description = __( 'The "from" email address for all emails.', 'email-subscribers' ); $from_email = get_option( 'ig_es_from_email' ); $from_email_description .= '
' . self::get_from_email_notice( $from_email ); $general_settings = array( 'sender_information' => array( 'id' => 'sender_information', 'name' => __( 'Sender', 'email-subscribers' ), 'sub_fields' => array( 'from_name' => array( 'id' => 'ig_es_from_name', 'name' => __( 'Name', 'email-subscribers' ), 'desc' => __( 'The "from" name people will see when they receive emails.', 'email-subscribers' ), 'type' => 'text', 'placeholder' => __( 'Name', 'email-subscribers' ), 'default' => '', ), 'from_email' => array( 'id' => 'ig_es_from_email', 'name' => __( 'Email', 'email-subscribers' ), 'desc' => $from_email_description, 'type' => 'text', 'placeholder' => __( 'Email Address', 'email-subscribers' ), 'default' => '', ), ), ), 'admin_email' => array( 'id' => 'ig_es_admin_emails', 'name' => __( 'Admin emails', 'email-subscribers' ), 'info' => __( 'Who should be notified about system events like "someone subscribed", "campaign sent" etc?', 'email-subscribers' ), 'type' => 'text', 'desc' => __( 'You can enter multiple email addresses - separate them with comma', 'email-subscribers' ), 'default' => '', ), 'ig_es_optin_type' => array( 'id' => 'ig_es_optin_type', 'name' => __( 'Opt-in type', 'email-subscribers' ), 'info' => '', 'desc' => __( 'Single = confirm subscribers as they subscribe.
Double = send a confirmation email and require clicking on a link to confirm subscription.', 'email-subscribers' ), 'type' => 'select', 'options' => ES_Common::get_optin_types(), 'default' => '', ), // Start-IG-Code. 'ig_es_post_image_size' => array( 'id' => 'ig_es_post_image_size', 'name' => __( 'Image size', 'email-subscribers' ), 'info' => __( 'Image to use in Post Notification emails' ), 'type' => 'select', 'options' => ES_Common::get_image_sizes(), /* translators: %s: Keyword */ 'desc' => sprintf( __( '%s keyword will use this image size. Use full size only if your template design needs it. Thumbnail should work well otherwise.', 'email-subscribers' ), '{{POSTIMAGE}}' ), 'default' => 'full', ), // End-IG-Code. 'ig_es_enable_ajax_form_submission' => array( 'id' => 'ig_es_enable_ajax_form_submission', 'name' => __( 'Enable AJAX subscription form submission', 'email-subscribers' ), 'info' => __( 'Enabling this will let users to submit their subscription form without page reload using AJAX call.', 'email-subscribers' ), 'type' => 'checkbox', 'default' => 'yes', ), 'ig_es_track_email_opens' => array( 'id' => 'ig_es_track_email_opens', 'name' => __( 'Track opens', 'email-subscribers' ), 'info' => __( 'Do you want to track when people view your emails? (We recommend keeping it enabled)', 'email-subscribers' ), 'type' => 'checkbox', 'default' => 'yes', ), 'ig_es_form_submission_success_message' => array( 'type' => 'textarea', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => '', 'id' => 'ig_es_form_submission_success_message', 'name' => __( 'Subscription success message', 'email-subscribers' ), 'info' => __( 'This message will show when a visitor successfully subscribes using the form.', 'email-subscribers' ), 'desc' => '', ), 'ig_es_unsubscribe_link_content' => array( 'type' => 'textarea', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => '', 'id' => 'ig_es_unsubscribe_link_content', 'name' => __( 'Unsubscribe text in email footer:', 'email-subscribers' ), 'info' => __( 'All emails will include this text in the footer so people can unsubscribe if they want.', 'email-subscribers' ), /* translators: %s: List of Keywords */ 'desc' => sprintf( __( 'Use %s keyword to add unsubscribe link.', 'email-subscribers' ), '{{UNSUBSCRIBE-LINK}}' ), ), 'subscription_messages' => array( 'id' => 'subscription_messages', 'name' => __( 'Double opt-in subscription messages:', 'email-subscribers' ), 'info' => __( 'Page and messages to show when people click on the link in a subscription confirmation email.', 'email-subscribers' ), 'sub_fields' => array( 'ig_es_subscription_success_message' => array( 'type' => 'textarea', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => __( 'You have been subscribed successfully!', 'email-subscribers' ), 'id' => 'ig_es_subscription_success_message', 'name' => __( 'Message on successful subscription', 'email-subscribers' ), 'desc' => __( 'Show this message if contact is successfully subscribed from double opt-in (confirmation) email', 'email-subscribers' ), ), 'ig_es_subscription_error_messsage' => array( 'type' => 'textarea', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => __( 'Oops.. Your request couldn\'t be completed. This email address seems to be already subscribed / blocked.', 'email-subscribers' ), 'id' => 'ig_es_subscription_error_messsage', 'name' => __( 'Message when subscription fails', 'email-subscribers' ), 'desc' => __( 'Show this message if any error occured after clicking confirmation link from double opt-in (confirmation) email.', 'email-subscribers' ), ), ), ), 'unsubscription_messages' => array( 'id' => 'unsubscription_messages', 'name' => __( 'Unsubscribe messages', 'email-subscribers' ), 'info' => __( 'Page and messages to show when people click on the unsubscribe link in an email\'s footer.', 'email-subscribers' ), 'sub_fields' => array( 'ig_es_unsubscribe_success_message' => array( 'type' => 'textarea', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => __( 'Thank You, You have been successfully unsubscribed. You will no longer hear from us.', 'email-subscribers' ), 'id' => 'ig_es_unsubscribe_success_message', 'name' => __( 'Message on unsubscribe success', 'email-subscribers' ), 'desc' => __( 'Once contact clicks on unsubscribe link, he/she will be redirected to a page where this message will be shown.', 'email-subscribers' ), ), 'ig_es_unsubscribe_error_message' => array( 'type' => 'textarea', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => __( 'Oops.. There was some technical error. Please try again later or contact us.', 'email-subscribers' ), 'id' => 'ig_es_unsubscribe_error_message', 'name' => __( 'Message when unsubscribe fails', 'email-subscribers' ), 'desc' => __( 'Show this message if any error occured after clicking on unsubscribe link.', 'email-subscribers' ), ), ), ), // Start-IG-Code. 'ig_es_powered_by' => array( 'id' => 'ig_es_powered_by', 'name' => __( 'Share Icegram', 'email-subscribers' ), 'info' => __( 'Show "Powered By" link in the unsubscription form' ), 'type' => 'checkbox', 'default' => 'no', ), // End-IG-Code. 'ig_es_delete_plugin_data' => array( 'id' => 'ig_es_delete_plugin_data', 'name' => __( 'Delete plugin data on uninstall', 'email-subscribers' ), 'info' => __( 'Be careful with this! When enabled, it will remove all lists, campaigns and other data if you uninstall the plugin.', 'email-subscribers' ), 'type' => 'checkbox', 'default' => 'no', ), ); $general_settings = apply_filters( 'ig_es_registered_general_settings', $general_settings ); $signup_confirmation_settings = array( 'worflow_migration_notice' => array( 'id' => 'worflow_migration_notice', 'type' => 'html', 'html' => self::get_workflow_migration_notice_html(), ), ); $signup_confirmation_settings = apply_filters( 'ig_es_registered_signup_confirmation_settings', $signup_confirmation_settings ); if ( ES()->trial->is_trial_valid() || ES()->is_premium() ) { $gmt_offset = ig_es_get_gmt_offset( true ); $icegram_cron_last_hit_timestamp = get_option( 'ig_es_cron_last_hit' ); $icegram_cron_last_hit_message = ''; if ( !empty( $icegram_cron_last_hit_timestamp['icegram_timestamp'] ) ) { $icegram_timestamp_with_gmt_offset = $icegram_cron_last_hit_timestamp['icegram_timestamp'] + $gmt_offset; $icegram_cron_last_hit_date_and_time = ES_Common::convert_timestamp_to_date( $icegram_timestamp_with_gmt_offset ); $icegram_cron_last_hit_message = __( '
Cron last hit time : ' . $icegram_cron_last_hit_date_and_time . '', 'email-subscribers' ); } } $cron_url_setting_desc = ''; if ( ES()->trial->is_trial_valid() || ES()->is_premium() ) { $cron_url_setting_desc = __( ' We will take care of it. You don\'t need to visit this URL manually.' . $icegram_cron_last_hit_message, 'email-subscribers' ); } else { /* translators: %s: Link to Icegram documentation */ $cron_url_setting_desc = sprintf( __( "You need to visit this URL to send email notifications. Know how to run this in background", 'email-subscribers' ), 'https://www.icegram.com/documentation/es-how-to-schedule-cron-emails-in-cpanel/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page' ); } $cron_url_setting_desc .= '
' . esc_html__( 'How to configure Email Sending', 'email-subscribers' ) . '→
'; $pepipost_api_key_defined = ES()->is_const_defined( 'pepipost', 'api_key' ); $test_email = ES_Common::get_admin_email(); $total_emails_sent = ES_Common::count_sent_emails(); $account_url = ES()->mailer->get_current_mailer_account_url(); $email_sending_settings = array( 'ig_es_cronurl' => array( 'type' => 'text', 'placeholder' => '', 'supplemental' => '', 'default' => '', 'readonly' => 'readonly', 'id' => 'ig_es_cronurl', 'name' => __( 'Cron URL', 'email-subscribers' ), 'desc' => $cron_url_setting_desc, ), 'ig_es_disable_wp_cron' => array( 'type' => 'checkbox', 'placeholder' => '', 'supplemental' => '', 'default' => 'no', 'id' => 'ig_es_disable_wp_cron', 'name' => __( 'Disable Wordpress Cron', 'email-subscribers' ), 'info' => __( 'Enable this option if you do not want Icegram Express to use WP Cron to send emails.', 'email-subscribers' ), ), 'ig_es_cron_interval' => array( 'id' => 'ig_es_cron_interval', 'name' => __( 'Send emails at most every', 'email-subscribers' ), 'type' => 'select', 'options' => ES()->cron->cron_intervals(), 'desc' => __( 'Optional if a real cron service is used', 'email-subscribers' ), 'default' => IG_ES_CRON_INTERVAL, ), 'ig_es_hourly_email_send_limit' => array( 'type' => 'number', 'placeholder' => '', 'supplemental' => '', 'default' => 50, 'id' => 'ig_es_hourly_email_send_limit', 'name' => __( 'Maximum emails to send in an hour', 'email-subscribers' ), /* translators: 1. Break tag 2. ESP Account url with anchor tag 3. ESP name 4. Closing anchor tag */ 'desc' => __( 'Total emails sent in current hour: ' . $total_emails_sent . '' , 'email-subscribers' ) . ( $account_url ? sprintf( __( '%1$sCheck sending limit from your %2$s%3$s\'s account%4$s.', 'email-subscribers' ), '
', '', ES()->mailer->get_current_mailer_name(), '' ) : '' ), ), 'ig_es_max_email_send_at_once' => array( 'type' => 'number', 'placeholder' => '', 'supplemental' => '', 'default' => IG_ES_MAX_EMAIL_SEND_AT_ONCE, 'id' => 'ig_es_max_email_send_at_once', 'name' => __( 'Maximum emails to send at once', 'email-subscribers' ), 'desc' => __( 'Maximum emails you want to send on every cron request.', 'email-subscribers' ), ), 'ig_es_test_send_email' => array( 'type' => 'html', 'html' => self::get_test_send_email_html( $test_email ), 'placeholder' => '', 'supplemental' => '', 'default' => '', 'id' => 'ig_es_test_send_email', 'name' => __( 'Send test email', 'email-subscribers' ), 'desc' => __( 'Enter email address to send test email.', 'email-subscribers' ), ), 'ig_es_mailer_settings' => array( 'type' => 'html', 'sub_fields' => array( 'mailer' => array( 'id' => 'ig_es_mailer_settings[mailer]', 'name' => __( 'Select Mailer', 'email-subscribers' ), 'type' => 'html', 'html' => self::mailers_html(), 'desc' => '', ), 'ig_es_pepipost_api_key' => array( 'type' => $pepipost_api_key_defined ? 'text' : 'password', 'options' => false, 'placeholder' => '', 'supplemental' => '', 'default' => '', 'id' => 'ig_es_mailer_settings[pepipost][api_key]', 'name' => __( 'Pepipost API key', 'email-subscribers' ), 'desc' => $pepipost_api_key_defined ? ES()->get_const_set_message( 'pepipost', 'api_key' ) : '', 'class' => 'pepipost', 'disabled' => $pepipost_api_key_defined ? 'disabled' : '', 'value' => $pepipost_api_key_defined ? '******************' : '', ), 'ig_es_pepipost_docblock' => array( 'type' => 'html', 'html' => self::pepipost_doc_block(), 'id' => 'ig_es_pepipost_docblock', 'name' => '', ), ), 'placeholder' => '', 'supplemental' => '', 'default' => '', 'id' => 'ig_es_mailer_settings', 'name' => __( 'Email Sender', 'email-subscribers' ), 'info' => '', ), ); $email_sending_settings = apply_filters( 'ig_es_registered_email_sending_settings', $email_sending_settings ); $security_settings = array( 'blocked_domains' => array( 'id' => 'ig_es_blocked_domains', 'name' => __( 'Blocked domain(s)', 'email-subscribers' ), 'type' => 'textarea', 'info' => __( 'Seeing spam signups from particular domains? Enter domains names (one per line) that you want to block here.', 'email-subscribers' ), 'default' => '', 'rows' => 3, ), ); $security_settings = apply_filters( 'ig_es_registered_security_settings', $security_settings ); $es_settings = array( 'general' => $general_settings, 'signup_confirmation' => $signup_confirmation_settings, 'email_sending' => $email_sending_settings, 'security_settings' => $security_settings, ); if ( ES_Common::is_rest_api_supported() ) { $rest_api_endpoint = get_rest_url( null, 'email-subscribers/v1/subscribers' ); $rest_api_settings = array( 'allow_api' => array( 'id' => 'ig_es_allow_api', 'name' => __( 'Enable API', 'email-subscribers' ), 'info' => __( 'Enable API to add/edit/delete subscribers through third-party sites or apps.', 'email-subscribers' ), 'type' => 'checkbox', 'default' => 'no', /* translators: REST API endpoint */ 'desc' => sprintf( __( 'URL endpoint: %s', 'email-subscribers'), '' . $rest_api_endpoint . '' ) ), 'api_key_access_section' => array( 'id' => 'ig_es_api_keys_section', 'name' => __( 'API Keys', 'email-subscribers' ), 'type' => 'html', 'html' => self::render_rest_api_keys_section(), ), ); $es_settings['rest_api_settings'] = $rest_api_settings; } return apply_filters( 'ig_es_registered_settings', $es_settings ); } public function field_callback( $arguments, $id_key = '' ) { $field_html = ''; if ( 'ig_es_cronurl' === $arguments['id'] ) { $value = ES()->cron->url(); } else { if ( ! empty( $arguments['option_value'] ) ) { preg_match( '(\[.*$)', $arguments['id'], $m ); $n = explode( '][', $m[0] ); $n = str_replace( '[', '', $n ); $n = str_replace( ']', '', $n ); $count = count( $n ); $id = ''; foreach ( $n as $key => $val ) { if ( '' == $id ) { $id = ! empty( $arguments['option_value'][ $val ] ) ? $arguments['option_value'][ $val ] : ''; } else { $id = ! empty( $id[ $val ] ) ? $id[ $val ] : ''; } } $value = $id; } else { $value = get_option( $arguments['id'] ); // Get the current value, if there is one } } if ( ! $value ) { // If no value exists $value = ! empty( $arguments['default'] ) ? $arguments['default'] : ''; // Set to our default } $uid = ! empty( $arguments['id'] ) ? $arguments['id'] : ''; $type = ! empty( $arguments['type'] ) ? $arguments['type'] : ''; $placeholder = ! empty( $arguments['placeholder'] ) ? $arguments['placeholder'] : ''; $readonly = ! empty( $arguments['readonly'] ) ? $arguments['readonly'] : ''; $html = ! empty( $arguments['html'] ) ? $arguments['html'] : ''; $id_key = ! empty( $id_key ) ? $id_key : $uid; $class = ! empty( $arguments['class'] ) ? $arguments['class'] : ''; $rows = ! empty( $arguments['rows'] ) ? $arguments['rows'] : 8; $disabled = ! empty( $arguments['disabled'] ) ? 'disabled="' . $arguments['disabled'] . '"' : ''; $value = ! empty( $arguments['value'] ) ? $arguments['value'] : $value; // Check which type of field we want switch ( $arguments['type'] ) { case 'text': // If it is a text field $field_html = sprintf( '', $uid, $id_key, $type, $placeholder, $value, $readonly, $class, $disabled ); break; case 'password': // If it is a text field $field_html = sprintf( '', $uid, $id_key, $type, $placeholder, $value, $readonly, $class, $disabled ); break; case 'number': // If it is a number field $field_html = sprintf( '', $uid, $type, $placeholder, $value, $readonly, $disabled ); break; case 'email': $field_html = sprintf( '', $uid, $id_key, $type, $placeholder, $value, $class, $disabled ); break; case 'textarea': $field_html = sprintf( '', $uid, $id_key, $placeholder, $value, $class, $rows, $disabled ); break; case 'file': $field_html = ' '; break; case 'checkbox': $field_html = ''; break; case 'select': if ( ! empty( $arguments['options'] ) && is_array( $arguments['options'] ) ) { $options_markup = ''; foreach ( $arguments['options'] as $key => $label ) { $options_markup .= sprintf( '', $key, selected( $value, $key, false ), $label ); } $field_html = sprintf( '', $uid, $id_key, $options_markup, $class, $disabled ); } break; case 'html': default: $field_html = $html; break; } // If there is help text if ( ! empty( $arguments['desc'] ) ) { $helper = $arguments['desc']; $field_html .= sprintf( '

%s

', $class, $helper ); // Show it } return $field_html; } public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } public function render_settings_fields( $fields ) { $html = ""; $html .= ''; foreach ( $fields as $key => $field ) { if ( ! empty( $field['name'] ) ) { $html .= "'; $html .= ''; } $html .= "'; } $button_html = empty( $button_html ) ? '' : $button_html; $nonce_field = wp_nonce_field( 'update-settings', 'update-settings', true, false ); $html .= $button_html . "'; $html .= ''; $html .= '
"; $html .= $field['name']; if ( ! empty( $field['is_premium'] ) ) { $premium_plan = isset( $field['plan'] ) ? $field['plan'] : ''; $html .= ''; } // If there is help text if ( ! empty( $field['info'] ) ) { $helper = $field['info']; $html .= '
' . sprintf( '

%s

', $helper ); // Show it } $button_html = '
"; if ( ! empty( $field['upgrade_desc'] ) ) { $html .= "
"; } if ( ! empty( $field['sub_fields'] ) ) { $option_key = ''; foreach ( $field['sub_fields'] as $field_key => $sub_field ) { if ( strpos( $sub_field['id'], '[' ) ) { $parts = explode( '[', $sub_field['id'] ); if ( $option_key !== $parts[0] ) { $option_value = get_option( $parts[0] ); $option_key = $parts[0]; } $sub_field['option_value'] = is_array( $option_value ) ? $option_value : ''; } $class = ( ! empty( $sub_field['class'] ) ) ? $sub_field['class'] : ''; $html .= ( reset( $field['sub_fields'] ) !== $sub_field ) ? '

' . $sub_field['name'] . ''; if ( ! empty( $sub_field['tooltip_text'] ) ) { $tooltip_html = ES_Common::get_tooltip_html( $sub_field['tooltip_text'] ); $html .= $tooltip_html; } $html .= '

'; $html .= $this->field_callback( $sub_field, $field_key ); } } else { $html .= $this->field_callback( $field ); } if ( ! empty( $field['upgrade_desc'] ) ) { $upsell_info = array( 'upgrade_title' => $field['upgrade_title'], 'pricing_url' => $field['link'], 'upsell_message' => $field['upgrade_desc'], 'cta_html' => false, ); $html .= '
'; $html .= ES_Common::upsell_description_message_box( $upsell_info, false ); $html .= '
'; } $html .= '
"; $html .= ''; $html .= ''; $html .= $nonce_field; $html .= ''; $html .= '
'; $allowedtags = ig_es_allowed_html_tags_in_esc(); add_filter( 'safe_style_css', 'ig_es_allowed_css_style' ); echo wp_kses( $html, $allowedtags ); } /** * Prepare Mailers Setting * * @return string * * @modify 4.3.12 */ public static function mailers_html() { $html = ''; $es_email_type = get_option( 'ig_es_email_type', '' ); $selected_mailer_settings = get_option( 'ig_es_mailer_settings', array() ); $selected_mailer = ''; if ( ! empty( $selected_mailer_settings ) && ! empty( $selected_mailer_settings['mailer'] ) ) { $selected_mailer = $selected_mailer_settings['mailer']; } else { $php_email_type_values = array( 'php_html_mail', 'php_plaintext_mail', 'phpmail', ); if ( in_array( $es_email_type, $php_email_type_values, true ) ) { $selected_mailer = 'phpmail'; } } $pepipost_doc_block = ''; $mailers = array( 'wpmail' => array( 'name' => 'WP Mail', 'logo' => ES_PLUGIN_URL . 'lite/admin/images/wpmail.png', ), 'phpmail' => array( 'name' => 'PHP mail', 'logo' => ES_PLUGIN_URL . 'lite/admin/images/phpmail.png', ), 'pepipost' => array( 'name' => 'Pepipost', 'logo' => ES_PLUGIN_URL . 'lite/admin/images/pepipost.png', 'docblock' => $pepipost_doc_block, ), ); $mailers = apply_filters( 'ig_es_mailers', $mailers ); $selected_mailer = ( array_key_exists( $selected_mailer, $mailers ) ) ? $selected_mailer : 'wpmail'; foreach ( $mailers as $key => $mailer ) { $html .= ''; } return $html; } /** * Prepare Icegram Mailer Setting * * @return string */ public static function get_icegram_mailer_html() { $html = ''; $opted_for_sending_service = get_option( 'ig_es_ess_opted_for_sending_service', 'no' ); $es_ess_data = get_option( 'ig_es_ess_data', '' ); $current_month = ig_es_get_current_month(); $allocated_limit = isset( $es_ess_data['allocated_limit'] ) ? $es_ess_data['allocated_limit']: 0; $used_limit = isset( $es_ess_data['used_limit'][$current_month] ) ? $es_ess_data['used_limit'][$current_month] : 0; $plan = ES_Service_Email_Sending::get_plan(); $premium_plans = array( 'pro', 'max' ); $is_premium_plan = in_array( $plan, $premium_plans, true ); $is_ess_branding_enabled = ES_Service_Email_Sending::is_ess_branding_enabled(); ob_start(); ?>

' ); ?>

' ); ?>


', $test_email, ES_PLUGIN_URL . 'lite/public/images/spinner.gif' ); return $html; } public static function pepipost_doc_block() { $html = ''; $url = ES_Common::get_utm_tracking_url( array( 'url' => 'https://www.icegram.com/email-subscribers-integrates-with-pepipost', 'utm_medium' => 'pepipost_doc', ) ); ob_start(); do_action('ig_es_before_get_pepipost_doc_block'); ?>
cron->is_wp_cron_enable(); if ( $es_cron_enabled ) { $es_cron_info = array( 'ig_es_cron_info' => array( 'id' => 'ig_es_cron_info', 'name' => __( 'Cron Info', 'email-subscribers' ), 'type' => 'html', 'html' => self::render_cron_info_html(), ), ); $email_sending_settings = ig_es_array_insert_after( $email_sending_settings, 'ig_es_cronurl', $es_cron_info ); } $opted_for_sending_service = get_option( 'ig_es_ess_opted_for_sending_service', '' ); if ( ! empty( $opted_for_sending_service ) ) { $sending_service_setting = array( 'ig_es_icegram_mailer_info' => array( 'type' => 'html', 'html' => self::get_icegram_mailer_html(), 'id' => 'ig_es_icegram_mailer_info', 'name' => ' ', ), ); $email_sending_settings = ig_es_array_insert_after( $email_sending_settings, 'ig_es_test_send_email', $sending_service_setting ); } return $email_sending_settings; } /** * Render ES cron info html * * @return false|string * * @since 4.4.9 */ public static function render_cron_info_html() { $site_crons = get_option( 'cron' ); if ( empty( $site_crons ) ) { return; } $es_cron_enabled = ES()->cron->is_wp_cron_enable(); $es_crons_data = array(); $es_cron_events = array( 'ig_es_cron', 'ig_es_cron_worker', 'ig_es_cron_auto_responder', 'ig_es_summary_automation', ); $cron_schedules = wp_get_schedules(); $time_offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS; $date_format = get_option( 'date_format' ); $time_format = get_option( 'time_format' ); foreach ( $site_crons as $next_scheduled_time => $scheduled_crons ) { if ( ! empty( $scheduled_crons ) && is_array( $scheduled_crons ) ) { foreach ( $scheduled_crons as $cron_event => $cron_data ) { if ( ! in_array( $cron_event, $es_cron_events, true ) ) { continue; } foreach ( $cron_data as $cron_info ) { if ( ! empty( $cron_info['schedule'] ) ) { $cron_schedule = $cron_info['schedule']; $cron_interval = ! empty( $cron_schedules[ $cron_schedule ]['interval'] ) ? $cron_schedules[ $cron_schedule ]['interval'] : 0; $es_crons_data[ $cron_event ] = array( 'cron_interval' => $cron_interval, 'next_scheduled_time' => $next_scheduled_time, ); } } } } } $html = ''; if ( ! empty( $es_crons_data ) ) { ob_start(); ?> cron->get_cron_interval(); } } if ( empty( $cron_interval ) || empty( $next_scheduled_time ) ) { continue; } ?>

is_premium() && ! ES()->trial->is_trial_valid() ) { $allow_tracking = array( 'ig_es_allow_tracking' => array( 'id' => 'ig_es_allow_tracking', 'name' => __( 'Plugin usage tracking', 'email-subscribers' ), 'type' => 'checkbox', 'default' => 'no', 'info' => __( 'Help us to improve Icegram Express by opting in to share non-sensitive plugin usage data.', 'email-subscribers' ), ), ); $general_fields = $es_settings['general']; $general_fields = ig_es_array_insert_after( $general_fields, 'ig_es_intermediate_unsubscribe_page', $allow_tracking ); $es_settings['general'] = $general_fields; } return $es_settings; } /** * Get HTML for workflow migration * * @return string */ public static function get_workflow_migration_notice_html() { ob_start(); $workflow_url = admin_url( 'admin.php?page=es_workflows' ); ?>

', '' ); ?>

'ig_es_rest_api_keys', 'fields' => 'ID' ) ); ?>
$rest_api_key ) { $key_start = substr( $rest_api_key, 0, 4 ); $key_end = substr( $rest_api_key, strlen( $rest_api_key ) - 4, 4 ); ?>
*********** data->user_login ); ?>
'administrator' ) ); ?>