Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af91bf8

Browse files
committed
bug #37899 [Mailer] Support reply-to in SesApiAsyncAwsTransport (cvmiert)
This PR was merged into the 5.1 branch. Discussion ---------- [Mailer] Support reply-to in SesApiAsyncAwsTransport | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Enable sending `SendEmailRequest`s with reply-to addresses with `SesApiAsyncAwsTransport`. Commits ------- 163e961 [Mailer] Support reply-to in SesApiAsyncAwsTransport
2 parents 5a91803 + 163e961 commit af91bf8

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 <[email protected]>', $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(['[email protected]', '[email protected]'], $content['ReplyToAddresses']);
7172

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

@@ -83,7 +84,8 @@ public function testSend()
8384
->to(new Address('[email protected]', 'Saif Eddin'))
8485
->from(new Address('[email protected]', 'Fabien'))
8586
->text('Hello There!')
86-
->html('<b>Hello There!</b>');
87+
->html('<b>Hello There!</b>')
88+
->replyTo(new Address('[email protected]'), new Address('[email protected]'));
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 ($emails = $email->getReplyTo()) {
90+
$request['ReplyToAddresses'] = $this->stringifyAddresses($emails);
91+
}
8992

9093
return new SendEmailRequest($request);
9194
}

0 commit comments

Comments
 (0)