8000 [Mailer] Support reply-to in SesApiAsyncAwsTransport · symfony/symfony@f366ee2 · GitHub
[go: up one dir, main page]

Skip to content

Commit f366ee2

Browse files
author
Clara van Miert
committed
[Mailer] Support reply-to in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with reply-to addresses with `SesApiAsyncAwsTransport`.
1 parent 5a91803 commit f366ee2

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
@@ -68,6 +68,7 @@ public function testSend()
6868
$this->assertSame('Fabien <fabpot@symfony.com>', $content['FromEmailAddress']);
6969
$this->assertSame('Hello There!', $content['Content']['Simple']['Body']['Text']['Data']);
7070
$this->assertSame('<b>Hello There!</b>', $content['Content']['Simple']['Body']['Html']['Data']);
71+
$this->assertSame(['replyto-1@example.com', 'replyto-2@example.com'], $content['ReplyToAddresses']);
7172

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

@@ -83,7 +84,8 @@ public function testSend()
8384
->to(new Address('saif.gmati@symfony.com', 'Saif Eddin'))
8485
->from(new Address('fabpot@symfony.com', 'Fabien'))
8586
->text('Hello There!')
86-
->html('<b>Hello There!</b>');
87+
->html('<b>Hello There!</b>')
88+
->replyTo(new Address('replyto-1@example.com'), new Address('replyto-2@example.com'));
8789

8890
$message = $transport->send($mail);
8991

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ protected function getRequest(SentMessage $message): SendEmailRequest
8686
'Charset' => $email->getHtmlCharset(),
8787
]);
8888
}
89+
if ($email->getReplyTo()) {
90+
$request['ReplyToAddresses'] = $this->stringifyAddresses($email->getReplyTo());
91+
}
8992

9093
return new SendEmailRequest($request);
9194
}

0 commit comments

Comments
 (0)
0