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

Skip to content

[Mailer] Support Return-Path in SesApiAsyncAwsTransport #37913

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
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 Return-Path in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with a `Return-Path` configured in
`SesApiAsyncAwsTransport`.
  • Loading branch information
Clara van Miert committed Aug 22, 2020
commit 61754cb891aa3d28d65da90c2a4afd6f4315a101
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function testSend()
$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']);
$this->assertSame('bounces@example.com', $content['FeedbackForwardingEmailAddress']);

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

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

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

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

return new SendEmailRequest($request);
}
Expand Down
0