class AmazonSesClientFactory in Amazon SES 2.0.x
Factory class for AWS SesClient instances.
Hierarchy
- class \Drupal\amazon_ses\AmazonSesClientFactory
Expanded class hierarchy of AmazonSesClientFactory
1 string reference to 'AmazonSesClientFactory'
1 service uses AmazonSesClientFactory
File
- src/
AmazonSesClientFactory.php, line 11
Namespace
Drupal\amazon_sesView source
class AmazonSesClientFactory {
/**
* Creates an AWS SesClient instance.
*
* @param array $options
* The default client options.
* @param \Drupal\Core\Config\ConfigFactory $configFactory
* The config factory.
*
* @return \Aws\Ses\SesClient
* The client instance.
*/
public static function createInstance(array $options, ConfigFactory $configFactory) {
$settings = $configFactory
->get('aws_secrets_manager.settings');
$options['region'] = $settings
->get('aws_region');
$awsKey = $settings
->get('aws_key');
$awsSecret = $settings
->get('aws_secret');
if (!empty($awsKey) && !empty($awsSecret)) {
$options['credentials'] = [
'key' => $awsKey,
'secret' => $awsSecret,
];
}
return new SesClient($options);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AmazonSesClientFactory:: |
public static | function | Creates an AWS SesClient instance. |