get_label(); } /** * @inheritdoc */ public function display() { $options = new Options(); $mailer = $options->get( 'mail', 'mailer' ); ?>
wp_nonce_field(); ?>

is_const_defined( 'mail', 'from_email' ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-from_email" spellcheck="false" placeholder="get_processor()->get_default_email() ); ?>">



get( 'mail', 'from_email_force' ) ); ?> is_const_defined( 'mail', 'from_email_force' ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-from_email_force">

is_const_defined( 'mail', 'from_name' ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-from_name" spellcheck="false" placeholder="get_processor()->get_default_name() ); ?>">


get( 'mail', 'from_name_force' ) ); ?> is_const_defined( 'mail', 'from_name_force' ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-from_name_force">

get_providers()->get_options_all() as $provider ) : ?>
<?php echo esc_attr( $provider->get_title() ); ?>
get_slug(), $mailer ); ?> is_const_defined( 'mail', 'mailer' ) ? 'disabled' : ''; ?> />
get( 'mail', 'return_path' ) ); ?> is_const_defined( 'mail', 'return_path' ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-return_path">


get_providers()->get_options_all() as $provider ) : ?>
get_description(); ?>

get_title(); ?>

display_options(); ?>

display_wpforms(); } /** * Display a WPForms-related message. * * @since 1.3.0 */ protected function display_wpforms() { // Do not display if WPForms Pro already installed. if ( class_exists( 'WPForms_Pro', false ) ) { return; } $is_dismissed = get_user_meta( get_current_user_id(), 'wp_mail_smtp_wpforms_dismissed', true ); // Do not display if user dismissed. if ( (bool) $is_dismissed === true ) { return; } ?>

purchasing a WPForms Pro license. Aside from getting access to the best drag & drop WordPress form builder plugin, your purchase will help us continue to maintain and add new features to the WP Mail SMTP plugin while keeping this SMTP plugin free for the larger WordPress community.', 'wp-mail-smtp' ), array( 'a' => array( 'href' => array(), 'target' => array(), 'rel' => array(), ), ) ), 'https://wpforms.com/?discount=THANKYOU&utm_source=WordPress&utm_medium=settings-cta&utm_campaign=smtpplugin' ); ?>

' ); ?>

Get WPForms Pro and support WP Mail SMTP - use coupon "thankyou" to save %2$s off your purchase.', 'wp-mail-smtp' ), array( 'a' => array( 'href' => array(), 'target' => array(), 'rel' => array(), ), 'strong' => array(), ) ), 'https://wpforms.com/?discount=THANKYOU&utm_source=WordPress&utm_medium=settings-cta&utm_campaign=smtpplugin', '20%' ); ?>

check_admin_referer(); $options = new Options(); $old_opt = $options->get_all(); // When checkbox is unchecked - it's not submitted at all, so we need to define its default false value. if ( ! isset( $data['mail']['from_email_force'] ) ) { $data['mail']['from_email_force'] = false; } if ( ! isset( $data['mail']['from_name_force'] ) ) { $data['mail']['from_name_force'] = false; } if ( ! isset( $data['mail']['return_path'] ) ) { $data['mail']['return_path'] = false; } if ( ! isset( $data['smtp']['autotls'] ) ) { $data['smtp']['autotls'] = false; } if ( ! isset( $data['smtp']['auth'] ) ) { $data['smtp']['auth'] = false; } // Remove all debug messages when switching mailers. if ( $old_opt['mail']['mailer'] !== $data['mail']['mailer'] ) { Debug::clear(); } $to_redirect = false; // Old and new Gmail client id/secret values are different - we need to invalidate tokens and scroll to Auth button. if ( $options->get( 'mail', 'mailer' ) === 'gmail' && ! empty( $data['gmail']['client_id'] ) && ! empty( $data['gmail']['client_secret'] ) && ( $options->get( 'gmail', 'client_id' ) !== $data['gmail']['client_id'] || $options->get( 'gmail', 'client_secret' ) !== $data['gmail']['client_secret'] ) ) { unset( $old_opt['gmail'] ); if ( ! empty( $data['gmail']['client_id'] ) && ! empty( $data['gmail']['client_secret'] ) ) { $to_redirect = true; } } // New gmail clients data will be added from new $data. $to_save = Options::array_merge_recursive( $old_opt, $data ); // All the sanitization is done in Options class. $options->set( $to_save ); if ( $to_redirect ) { wp_redirect( $_POST['_wp_http_referer'] . '#wp-mail-smtp-setting-row-gmail-authorize' ); exit; } WP::add_admin_notice( esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ), WP::ADMIN_NOTICE_SUCCESS ); } }