Home / Admin / Use Single Tenant With the Outlook Mailer
Duplicate Snippet

Embed Snippet on Your Site

Use Single Tenant With the Outlook Mailer

This snippet will set the Outlook API authorization and access token URLs to use your unique tenant ID.

On line 7 and line 12, you’ll need to replace my_tenant_id with your actual tenant ID.

Code Preview
php
<?php
/* Use Single Tenant With the Outlook Mailer  
 * 
 * Original doc: https://wpmailsmtp.com/docs/using-single-tenant-with-the-outlook-mailer/
*/
add_filter( 'wp_mail_smtp_pro_providers_outlook_auth_authorize_url', function ( $url ) {
	$tenant_id = 'my_tenant_id';
	return str_replace( '/common/', "/{$tenant_id}/", $url );
} );
add_filter( 'wp_mail_smtp_pro_providers_outlook_auth_access_token_url', function ( $url ) {
	$tenant_id = 'my_tenant_id';
	return str_replace( '/common/', "/{$tenant_id}/", $url );
} );

Comments

Add a Comment