/home/vianto5/distritosatelite.mx/wp-content/plugins/wp-mail-smtp/src/Admin
Edit: /home/vianto5/distritosatelite.mx/wp-content/plugins/wp-mail-smtp/src/Admin/ConnectionSettings.php (18023B)
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();
$hide_from_email = false;
$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';
}
if (
$mailer === 'sendlayer' &&
$connection_options->get( 'sendlayer', 'quick_connect' ) &&
$connection_options->get( 'sendlayer', 'is_shared_domain' )
) {
// For SendLayer, hide the From Email setting since it's managed from the SendLayer dashboard.
$hide_from_email = true;
}
$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 ),
]
);
?>
connection, $connection_options, $mailer );
?>
'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 ) : ?>
%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(); ?>
connection->get_id() );
}
// Prevent redirect to setup wizard from settings page after successful auth.
if (
! empty( $data['mail']['mailer'] ) &&
in_array( $data['mail']['mailer'], [ 'gmail', 'outlook', 'zoho' ], true )
) {
$data[ $data['mail']['mailer'] ]['is_setup_wizard_auth'] = false;
}
/**
* Filters connection data.
*
* @since 3.11.0
*
* @param array $data Connection data.
* @param array $old_data Old connection data.
*/
return apply_filters( 'wp_mail_smtp_admin_connection_settings_process_data', $data, $old_data );
}
/**
* Post process connection settings. Should be called after options save.
*
* @since 3.7.0
*
* @param array $data Connection data.
* @param array $old_data Old connection data.
*/
public function post_process( $data, $old_data ) {
// When switching mailers.
if (
! empty( $old_data['mail']['mailer'] ) &&
! empty( $data['mail']['mailer'] ) &&
$old_data['mail']['mailer'] !== $data['mail']['mailer']
) {
// Save correct from email address if Gmail or Outlook mailer is already configured.
if ( in_array( $data['mail']['mailer'], [ 'gmail', 'outlook' ], true ) ) {
$auth = wp_mail_smtp()->get_providers()->get_auth( $data['mail']['mailer'], $this->connection );
$user_info = ! $auth->is_auth_required() ? $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;
}
}