Skip to content

Commit

Permalink
bug #37899 [Mailer] Support reply-to in SesApiAsyncAwsTransport (cvmi…
Browse files Browse the repository at this point in the history
…ert)

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
  • Loading branch information
fabpot committed Aug 21, 2020
2 parents 5a91803 + 163e961 commit af91bf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function testSend()
$this->assertSame('Fabien <fabpot@symfony.com>', $content['FromEmailAddress']);
$this->assertSame('Hello There!', $content['Content']['Simple']['Body']['Text']['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']);

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

Expand All @@ -83,7 +84,8 @@ public function testSend()
->to(new Address('saif.gmati@symfony.com', 'Saif Eddin'))
->from(new Address('fabpot@symfony.com', 'Fabien'))
->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'));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ protected function getRequest(SentMessage $message): SendEmailRequest
'Charset' => $email->getHtmlCharset(),
]);
}
if ($emails = $email->getReplyTo()) {
$request['ReplyToAddresses'] = $this->stringifyAddresses($emails);
}

return new SendEmailRequest($request);
}
Expand Down

0 comments on commit af91bf8

Please sign in to comment.