gcdtech / rhubarb-module-amazon-ses-email-provider
1.1.1
2019-07-11 15:26 UTC
Requires
- gcdtech/rhubarb-module-aws: ^1.0
- rhubarbphp/custard: ^1.0.0
- rhubarbphp/rhubarb: ^1.6.11
README
快速开始
以下是该电子邮件提供商的示例配置
// Generic AwsSettings
$aws = AwsSettings::singleton();
$aws->region = 'eu-west-1';
$aws->profile = 'default';
// Set credentials
// Using credentials.ini
$aws->iniCredentialsFile = '/path/to/credentials.ini';
// OR using access key and secret
$aws->credentialsAccessKeyId = 'abc123';
$aws->credentialsSecretAccessKey = 'abc123';
// OR Do not specify either of the above to use IAM role permission of the EC2 instance this code will run on
// Configure all the domains to send from with their matching ARN's from SES console
AmazonSesSettings::singleton()->arnMappings = [
'<domain>' => 'arn:aws:ses:<region>:<account id>:identity/<domain>'
];
// Finally, set the provider
EmailProvider::setProviderClassName(AmazonSesEmailProvider::class);
退信处理
如果您已将SES Handler 工具部署到 lambda,您可以指定一个 lambda 名称,如下所示。
AmazonSesSettings::singleton()->verificationLambdaName = '<verification lambda name>';
这将自动处理电子邮件地址的退信,并确保之前产生退信的邮件不会再次发送。这个工具是从一个问题中产生的,即由于退信率过高,一个 SES 账户被禁用。此工具还跟踪退信率,并在退信率超过安全限制时禁用特定域的发送,这是为了确保亚马逊不会禁用 SES 账户,因为这需要一些时间才能重新启用。