[Mailer] Support Return-Path in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with a `Return-Path` configured in `SesApiAsyncAwsTransport`.
This commit is contained in:
parent
0611b6331c
commit
61754cb891
@ -69,6 +69,7 @@ class SesApiAsyncAwsTransportTest extends TestCase
|
|||||||
$this->assertSame('Hello There!', $content['Content']['Simple']['Body']['Text']['Data']);
|
$this->assertSame('Hello There!', $content['Content']['Simple']['Body']['Text']['Data']);
|
||||||
$this->assertSame('<b>Hello There!</b>', $content['Content']['Simple']['Body']['Html']['Data']);
|
$this->assertSame('<b>Hello There!</b>', $content['Content']['Simple']['Body']['Html']['Data']);
|
||||||
$this->assertSame(['replyto-1@example.com', 'replyto-2@example.com'], $content['ReplyToAddresses']);
|
$this->assertSame(['replyto-1@example.com', 'replyto-2@example.com'], $content['ReplyToAddresses']);
|
||||||
|
$this->assertSame('bounces@example.com', $content['FeedbackForwardingEmailAddress']);
|
||||||
|
|
||||||
$json = '{"MessageId": "foobar"}';
|
$json = '{"MessageId": "foobar"}';
|
||||||
|
|
||||||
@ -85,7 +86,8 @@ class SesApiAsyncAwsTransportTest extends TestCase
|
|||||||
->from(new Address('fabpot@symfony.com', 'Fabien'))
|
->from(new Address('fabpot@symfony.com', 'Fabien'))
|
||||||
->text('Hello There!')
|
->text('Hello There!')
|
||||||
->html('<b>Hello There!</b>')
|
->html('<b>Hello There!</b>')
|
||||||
->replyTo(new Address('replyto-1@example.com'), new Address('replyto-2@example.com'));
|
->replyTo(new Address('replyto-1@example.com'), new Address('replyto-2@example.com'))
|
||||||
|
->returnPath(new Address('bounces@example.com'));
|
||||||
|
|
||||||
$message = $transport->send($mail);
|
$message = $transport->send($mail);
|
||||||
|
|
||||||
|
@ -89,6 +89,9 @@ class SesApiAsyncAwsTransport extends SesHttpAsyncAwsTransport
|
|||||||
if ($emails = $email->getReplyTo()) {
|
if ($emails = $email->getReplyTo()) {
|
||||||
$request['ReplyToAddresses'] = $this->stringifyAddresses($emails);
|
$request['ReplyToAddresses'] = $this->stringifyAddresses($emails);
|
||||||
}
|
}
|
||||||
|
if ($email->getReturnPath()) {
|
||||||
|
$request['FeedbackForwardingEmailAddress'] = $email->getReturnPath()->toString();
|
||||||
|
}
|
||||||
|
|
||||||
return new SendEmailRequest($request);
|
return new SendEmailRequest($request);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user