boolean_smtp_microsoft_token_url
Filters the Microsoft identity platform token endpoint used to exchange or refresh delegated and application tokens.
filter Tier B Since 1.0.0
Return a different URL to override the resolved endpoint, for example for a sovereign cloud. Fired wherever the plugin or the Pro add-on talks to the token endpoint: the manual and scheduled refreshes, the Graph sender, the credential check and the application-permission mailer.
Signature
add_filter( 'boolean_smtp_microsoft_token_url', $callback, 10, 2 );Parameters
| Parameter | Type | Description |
|---|---|---|
$url | string | Token endpoint URL built from the tenant: `https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token`. |
$tenant | string | Microsoft tenant id or domain, or `common`, `organizations`, `consumers`. |
Returns string — The filtered URL.
Fires in
app/Http/Controllers/ConnectionController.php:1606—BooleanSmtp\Http\Controllers\ConnectionController::verifyOutlookCredentials()app/Http/Controllers/OAuthController.php:651—BooleanSmtp\Http\Controllers\OAuthController::microsoftTokenUrl()app/Services/Mailer/Api/MicrosoftGraphMailSender.php:1038—BooleanSmtp\Services\Mailer\Api\MicrosoftGraphMailSender::getValidAccessToken()app/Services/Mailer/OAuth/OAuthManualTokenExchange.php:243—BooleanSmtp\Services\Mailer\OAuth\OAuthManualTokenExchange::microsoft()boolean-smtp-pro/app/Services/Mailer/Api/MicrosoftAppPermissionMailer.php:137—BooleanSmtpPro\Services\Mailer\Api\MicrosoftAppPermissionMailer::getAccessToken()
Example
add_filter( 'boolean_smtp_microsoft_token_url', function ( string $url, string $tenant ) { return $url;}, 10, 2 );Next steps
- Connections and OAuth — every hook in this area, in firing order where that applies.
- Hook Explorer — filter and search every hook.