N°5102 - Allow to send emails using GSuite SMTP and OAuth - Rework

This commit is contained in:
Eric Espie
2022-06-22 16:37:31 +02:00
parent ba59643f52
commit 9f60f27636
66 changed files with 1513 additions and 1228 deletions

View File

@@ -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