get_label(); } /** * @inheritdoc */ public function display() { $options = new Options(); $mailer = $options->get( 'mail', 'mailer' ); $disabled_email = in_array( $mailer, [ 'gmail', 'outlook', 'zoho' ], true ) ? 'disabled' : ''; $disabled_name = 'outlook' === $mailer ? 'disabled' : ''; if ( empty( $mailer ) ) { $mailer = 'mail'; } $mailer_supported_settings = wp_mail_smtp()->get_providers()->get_options( $mailer )->get_supports(); ?>
wp_nonce_field(); ?>

is_const_defined( 'mail', 'from_email' ) || ! empty( $disabled_email ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-from_email" spellcheck="false" placeholder="get_processor()->get_default_email() ); ?>"> is_clients_saved() ? $gmail_auth->get_user_possible_send_from_addresses() : []; ?>



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

is_const_defined( 'mail', 'from_name' ) || ! empty( $disabled_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' ) || ! empty( $disabled_name ) ? 'disabled' : ''; ?> id="wp-mail-smtp-setting-from_name_force">

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 ) : ?>
<?php echo esc_attr( $provider->get_title() ); ?>
is_disabled() ) : ?> get_slug(), $mailer ); ?> is_const_defined( 'mail', 'mailer' ) || $provider->is_disabled() ? 'disabled' : ''; ?> />
get_providers()->get_options_all() as $provider ) : ?> get_description(); ?>
is_disabled() ) : ?> display_options(); ?>

get_title(); ?>

get_notice( 'educational' ); $is_dismissed = (bool) get_user_meta( get_current_user_id(), "wp_mail_smtp_notice_educational_for_{$provider->get_slug()}_dismissed", true ); if ( ! empty( $provider_edu_notice ) && ! $is_dismissed ) : ?>

display_options(); ?>
display_save_btn(); ?>
display_wpforms(); $this->display_pro_banner(); } /** * License key text for a Lite version of the plugin. * * @since 1.5.0 * * @param Options $options */ public static function display_license_key_field_content( $options ) { ?>

🙂

upgrading to PRO.', 'wp-mail-smtp' ), array( 'a' => array( 'href' => array(), 'class' => array(), 'target' => array(), 'rel' => array(), ), 'strong' => array(), ) ), esc_url( wp_mail_smtp()->get_upgrade_link( 'general-license-key' ) ) ); ?>

$50 off, automatically applied at checkout!', 'wp-mail-smtp' ), array( 'strong' => array(), 'br' => array(), ) ); ?>

is_pro() ) { return; } $is_dismissed = get_user_meta( get_current_user_id(), 'wp_mail_smtp_pro_banner_dismissed', true ); // Do not display if user dismissed. if ( (bool) $is_dismissed === true ) { return; } ?>

Get WP Mail SMTP Pro Today and Unlock all the Powerful Features »', 'wp-mail-smtp' ), array( 'a' => array( 'href' => array(), 'target' => array(), 'rel' => array(), ), 'strong' => array(), ) ), esc_url( wp_mail_smtp()->get_upgrade_link( 'general-cta' ) ) ); ?>

Bonus: WP Mail SMTP users get $50 off regular price, automatically applied at checkout.', 'wp-mail-smtp' ), array( 'strong' => array(), 'span' => array( 'class' => array(), ), ) ); ?>

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; } // When switching mailers. if ( ! empty( $old_opt['mail']['mailer'] ) && ! empty( $data['mail']['mailer'] ) && $old_opt['mail']['mailer'] !== $data['mail']['mailer'] ) { // Remove all debug messages when switching mailers. Debug::clear(); // Save correct from email address if Zoho or Outlook mailers are already configured. if ( in_array( $data['mail']['mailer'], [ 'zoho', 'outlook' ], true ) && ! empty( $old_opt[ $data['mail']['mailer'] ]['user_details']['email'] ) ) { $data['mail']['from_email'] = $old_opt[ $data['mail']['mailer'] ]['user_details']['email']; } } $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; } } $data = apply_filters( 'wp_mail_smtp_settings_tab_process_post', $data ); // All the sanitization is done in Options class. $options->set( $data, false, false ); 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 ); } }