wp_mail_smtp()->assets_url . '/images/providers/google.svg',
'slug' => self::SLUG,
'title' => esc_html__( 'Google / Gmail', 'wp-mail-smtp' ),
'description' => sprintf(
wp_kses( /* translators: %s - URL to our Gmail doc. */
__( 'Our Gmail mailer works with any Gmail or Google Workspace account via the Google API. You can send WordPress emails from your main email address or a Gmail alias, and it\'s more secure than connecting to Gmail using SMTP credentials. The setup steps are more technical than other options, so we created a detailed guide to walk you through the process.
To get started, read our Gmail documentation.', 'wp-mail-smtp' ),
[
'br' => [],
'b' => [],
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
),
esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/docs/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp/', 'Gmail documentation' ) )
),
'notices' => [
'educational' => wp_kses(
__( 'The Gmail mailer works well for sites that send low numbers of emails. However, Gmail\'s API has rate limitations and a number of additional restrictions that can lead to challenges during setup.
If you expect to send a high volume of emails, or if you find that your web host is not compatible with the Gmail API restrictions, then we recommend considering a different mailer option.', 'wp-mail-smtp' ),
[
'br' => [],
]
),
],
'php' => '5.6',
'supports' => [
'from_email' => true,
'from_name' => true,
'return_path' => false,
'from_email_force' => true,
'from_name_force' => true,
],
],
$connection
);
}
/**
* @inheritdoc
*/
public function display_options() {
// Do not display options if PHP version is not correct.
if ( ! $this->is_php_correct() ) {
$this->display_php_warning();
return;
}
?>
get_user_info(); if ( ! empty( $user['email'] ) ) { printf( /* translators: %s - email address, as received from Google API. */ esc_html__( 'Connected as %s', 'wp-mail-smtp' ), '
' . esc_html( $user['email'] ) . '
'
);
}
?>
Follow these instructions and then select the From Email at the top of this page.', 'wp-mail-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/gmail-send-from-alias-wp-mail-smtp/', 'Gmail aliases description - Follow these instructions' ) ) ); ?>
connection->get_mailer_slug() !== $this->get_slug() ) { return; } $old_opt = $this->connection_options->get_all_raw(); foreach ( $old_opt[ $this->get_slug() ] as $key => $value ) { // Unset everything except Client ID and Secret. if ( ! in_array( $key, array( 'client_id', 'client_secret' ), true ) ) { unset( $old_opt[ $this->get_slug() ][ $key ] ); } } $this->connection_options->set( $old_opt ); } }