connection = $connection; } /** * Display connection settings. * * @since 3.7.0 */ public function display() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded, Generic.Metrics.NestingLevel.MaxExceeded $mailer = $this->connection->get_mailer_slug(); $connection_options = $this->connection->get_options(); $disabled_email = in_array( $mailer, [ 'zoho' ], true ) ? 'disabled' : ''; $disabled_name = in_array( $mailer, [ 'outlook' ], true ) ? 'disabled' : ''; if ( empty( $mailer ) || ! in_array( $mailer, Options::$mailers, true ) ) { $mailer = 'mail'; } $mailer_supported_settings = wp_mail_smtp()->get_providers()->get_options( $mailer )->get_supports(); ?>
is_const_defined( 'mail', 'from_email' ) || ! empty( $disabled_email ) ); ?> />

'wp-mail-smtp[mail][from_email_force]', 'id' => 'wp-mail-smtp-setting-from_email_force', 'value' => 'true', 'checked' => (bool) $connection_options->get( 'mail', 'from_email_force' ), 'disabled' => $connection_options->is_const_defined( 'mail', 'from_email_force' ) || ! empty( $disabled_email ), ] ); ?>

is_const_defined( 'mail', 'from_name' ) || ! empty( $disabled_name ) ); ?> />

'wp-mail-smtp[mail][from_name_force]', 'id' => 'wp-mail-smtp-setting-from_name_force', 'value' => 'true', 'checked' => (bool) $connection_options->get( 'mail', 'from_name_force' ), 'disabled' => $connection_options->is_const_defined( 'mail', 'from_name_force' ) || ! empty( $disabled_name ), ] ); ?>

'wp-mail-smtp[mail][return_path]', 'id' => 'wp-mail-smtp-setting-return_path', 'value' => 'true', 'checked' => (bool) $connection_options->get( 'mail', 'return_path' ), 'disabled' => $connection_options->is_const_defined( 'mail', 'return_path' ), ] ); ?>


get_providers()->get_options_all( $this->connection ) as $provider ) : ?>
<?php echo esc_attr( $provider->get_title() ); ?>
is_disabled() ) : ?> get_slug(), $mailer ); ?> is_const_defined( 'mail', 'mailer' ) || $provider->is_disabled() ); ?> />

%2$s', esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/suggest-a-mailer/', 'Suggest a Mailer' ) ), esc_html__( 'Suggest a Mailer', 'wp-mail-smtp' ) ); ?>

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

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(); ?>
get_providers()->get_auth( 'gmail', $this->connection ); $user_info = ! $gmail_auth->is_auth_required() ? $gmail_auth->get_user_info() : false; if ( ! empty( $user_info['email'] ) && is_email( $user_info['email'] ) !== false && ( empty( $data['mail']['from_email'] ) || $data['mail']['from_email'] !== $user_info['email'] ) ) { $data['mail']['from_email'] = $user_info['email']; $this->connection->get_options()->set( $data, false, false ); } } } } /** * Get connection settings admin page URL. * * @since 3.7.0 * * @return string */ public function get_admin_page_url() { /** * Filters connection settings admin page URL. * * @since 3.7.0 * * @param string $admin_page_url Connection settings admin page URL. * @param ConnectionInterface $connection The Connection object. */ return apply_filters( 'wp_mail_smtp_admin_connection_settings_get_admin_page_url', wp_mail_smtp()->get_admin()->get_admin_page_url(), $this->connection ); } /** * Get after process scroll to anchor. Returns `false` if scroll is not needed. * * @since 3.7.0 */ public function get_scroll_to() { return $this->scroll_to; } }