8000 [Mailer] Support Return-Path in SesApiAsyncAwsTransport · symfony/symfony@47ef3a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47ef3a9

Browse files
author
Clara van Miert
committed
[Mailer] Support Return-Path in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with a `Return-Path` configured in `SesApiAsyncAwsTransport`.
1 parent 60ce71e commit 47ef3a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Symfony/Component/Mailer/Bridge/Amazon/Tests/Transport/SesApiAsyncAwsTransportTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function testSend()
6969
$this->assertSame('Hello There!', $content['Content']['Simple']['Body']['Text']['Data']);
7070
$this->assertSame('<b>Hello There!</b>', $content['Content']['Simple']['Body']['Html']['Data']);
7171
$this->assertSame(['replyto-1@example.com', 'replyto-2@example.com'], $content['ReplyToAddresses']);
72+
$this->assertSame('bounces@example.com', $content['FeedbackForwardingEmailAddress']);
7273

7374
$json = '{"MessageId": "foobar"}';
7475

@@ -85,7 +86,8 @@ public function testSend()
8586
->from(new Address('fabpot@symfony.com', 'Fabien'))
8687
->text('Hello There!')
8788
->html('<b>Hello There!</b>')
88-
->replyTo(new Address('replyto-1@example.com'), new Address('replyto-2@example.com'));
89+
->replyTo(new Address('replyto-1@example.com'), new Address('replyto-2@example.com'))
90+
->returnPath(new Address('bounces@example.com'));
8991

9092
$message = $transport->send($mail);
9193

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiAsyncAwsTransport.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ protected function getRequest(SentMessage $message): SendEmailRequest
8989
if ($emails = $email->getReplyTo()) {
9090
$request['ReplyToAddresses'] = $this->stringifyAddresses($emails);
9191
}
92+
if ($email->getReturnPath()) {
93+
$request['FeedbackForwardingEmailAddress'] = $email->getReturnPath()->toString();
94+
}
9295

9396
return new SendEmailRequest($request);
9497
}

0 commit comments

Comments
 (0)
0