Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d6b567d

Browse filesBrowse files
committed
bug #34029 [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths (ogizanagi)
This PR was merged into the 4.4 branch. Discussion ---------- [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | N/A <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | N/A As NamedAddress was removed in #33270 (4.4) and this bridge does require `symfony/mailer >= 4.4`. Commits ------- f14d082 [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths
2 parents 594e7ae + f14d082 commit d6b567d
Copy full SHA for d6b567d

File tree

Expand file treeCollapse file tree

1 file changed

+2
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-9
lines changed

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillApiTransport.php
+2-9Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Mailer\SentMessage;
1818
use Symfony\Component\Mailer\Transport\AbstractApiTransport;
1919
use Symfony\Component\Mime\Email;
20-
use Symfony\Component\Mime\NamedAddress;
2120
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2221
use Symfony\Contracts\HttpClient\HttpClientInterface;
2322
use Symfony\Contracts\HttpClient\ResponseInterface;
@@ -76,15 +75,12 @@ private function getPayload(Email $email, Envelope $envelope): array
7675
'html' => $email->getHtmlBody(),
7776
'text' => $email->getTextBody(),
7877
'subject' => $email->getSubject(),
78+
'from_name' => $envelope->getSender()->getName(),
7979
'from_email' => $envelope->getSender()->getAddress(),
8080
'to' => $this->getRecipients($email, $envelope),
8181
],
8282
];
8383

84-
if ($envelope->getSender() instanceof NamedAddress) {
85-
$payload['message']['from_name'] = $envelope->getSender()->getName();
86-
}
87-
8884
foreach ($email->getAttachments() as $attachment) {
8985
$headers = $attachment->getPreparedHeaders();
9086
$disposition = $headers->getHeaderBody('Content-Disposition');
@@ -126,13 +122,10 @@ protected function getRecipients(Email $email, Envelope $envelope): array
126122

127123
$recipientPayload = [
128124
'email' => $recipient->getAddress(),
125+
'name' => $recipient->getName(),
129126
'type' => $type,
130127
];
131128

132-
if ($recipient instanceof NamedAddress) {
133-
$recipientPayload['name'] = $recipient->getName();
134-
}
135-
136129
$recipients[] = $recipientPayload;
137130
}
138131

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.