Skip to content

Commit

Permalink
feature #33883 [Mailer] added ReplyTo option for PostmarkApiTransport…
Browse files Browse the repository at this point in the history
… (pierregaste)

This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] added ReplyTo option for PostmarkApiTransport

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Supports "ReplyTo" option with Postmark transport

Commits
-------

d49a738 [Mailer] added ReplyTo option for PostmarkApiTransport
  • Loading branch information
fabpot committed Oct 12, 2019
2 parents 38b9a27 + d49a738 commit a84ec3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Symfony/Component/Mailer/Bridge/Postmark/CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
4.4.0
-----

* added `ReplyTo` option
* [BC BREAK] Renamed and moved `Symfony\Component\Mailer\Bridge\Postmark\Http\Api\PostmarkTransport`
to `Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkApiTransport`, `Symfony\Component\Mailer\Bridge\Postmark\Smtp\PostmarkTransport`
to `Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkSmtpTransport`.
Expand Down
Expand Up @@ -67,13 +67,14 @@ private function getPayload(Email $email, Envelope $envelope): array
'To' => implode(',', $this->stringifyAddresses($this->getRecipients($email, $envelope))),
'Cc' => implode(',', $this->stringifyAddresses($email->getCc())),
'Bcc' => implode(',', $this->stringifyAddresses($email->getBcc())),
'ReplyTo' => implode(',', $this->stringifyAddresses($email->getReplyTo())),
'Subject' => $email->getSubject(),
'TextBody' => $email->getTextBody(),
'HtmlBody' => $email->getHtmlBody(),
'Attachments' => $this->getAttachments($email),
];

$headersToBypass = ['from', 'to', 'cc', 'bcc', 'subject', 'content-type', 'sender'];
$headersToBypass = ['from', 'to', 'cc', 'bcc', 'subject', 'content-type', 'sender', 'reply-to'];
foreach ($email->getHeaders()->all() as $name => $header) {
if (\in_array($name, $headersToBypass, true)) {
continue;
Expand Down

0 comments on commit a84ec3a

Please sign in to comment.