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(); ?>
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; } ?> 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 ); } }