8000 [Mailer] Support reply-to in SesApiAsyncAwsTransport by cvmiert · Pull Request #37899 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Mailer] Support reply-to in SesApiAsyncAwsTransport #37899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Mailer] Support reply-to in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with reply-to addresses with
`SesApiAsyncAwsTransport`.
  • Loading branch information
Clara van Miert committed Aug 20, 2020
commit 163e961b445b7cf639b875d509889b829fe87a44
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