mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°5102 - Allow to send emails using GSuite SMTP and OAuth - Rework
This commit is contained in:
@@ -58,14 +58,6 @@ abstract class OAuthClientProviderAbstract implements IOAuthClientProvider
|
||||
$this->oAccessToken = $oAccessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function GetVendorIcon(): string
|
||||
{
|
||||
return static::$sVendorIcon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -74,31 +66,6 @@ abstract class OAuthClientProviderAbstract implements IOAuthClientProvider
|
||||
return static::$sVendorName;
|
||||
}
|
||||
|
||||
|
||||
public static function getConfFromAccessToken($oAccessToken, $sClientId, $sClientSecret): string
|
||||
{
|
||||
$sAccessToken = $oAccessToken->getToken();
|
||||
$sRefreshToken = $oAccessToken->getRefreshToken();
|
||||
$sVendor = static::GetVendorName();
|
||||
|
||||
return <<<EOF
|
||||
'email_transport' => 'SMTP_OAuth',
|
||||
'email_transport_smtp.oauth.provider' => '$sVendor',
|
||||
'email_transport_smtp.oauth.client_id' => '$sClientId',
|
||||
'email_transport_smtp.oauth.client_secret' => '$sClientSecret',
|
||||
'email_transport_smtp.oauth.access_token' => '$sAccessToken',
|
||||
'email_transport_smtp.oauth.refresh_token' => '$sRefreshToken',
|
||||
EOF;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function GetVendorColors(): array
|
||||
{
|
||||
return static::$sVendorColors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
|
||||
Reference in New Issue
Block a user