Skip to content

Commit 2043a4b

Browse files
committed
wip
1 parent 967afb7 commit 2043a4b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"require": {
1919
"php": "^8.1",
2020
"illuminate/contracts": "^9.38",
21-
"illuminate/support": "^9.38",
2221
"spatie/laravel-package-tools": "^1.14.0",
2322
"symfony/mailer": "^6.0"
2423
},

src/MicrosoftGraphTransport.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ protected function doSend(SentMessage $message): void
5555
}
5656

5757
/**
58-
* @param Collection<Address> $recipients
58+
* @param Collection<Address> $recipients
5959
* @return array
6060
*/
6161
protected function transformEmailAddresses(Collection $recipients): array
6262
{
6363
return $recipients
64-
->map(fn (Address $recipient) => $this->transformEmailAddress($recipient))
64+
->map(fn(Address $recipient) => $this->transformEmailAddress($recipient))
6565
->toArray();
6666
}
6767

6868
/**
69-
* @param Address $address
69+
* @param Address $address
7070
* @return array
7171
*/
7272
protected function transformEmailAddress(Address $address): array
@@ -79,23 +79,24 @@ protected function transformEmailAddress(Address $address): array
7979
}
8080

8181
/**
82-
* @param Email $email
83-
* @param Envelope $envelope
82+
* @param Email $email
83+
* @param Envelope $envelope
8484
* @return Collection<Address>
8585
*/
8686
protected function getRecipients(Email $email, Envelope $envelope): Collection
8787
{
8888
return collect($envelope->getRecipients())
89-
->filter(fn (Address $address) => ! in_array($address, array_merge($email->getCc(), $email->getBcc()), true));
89+
->filter(fn(Address $address) => !in_array($address, array_merge($email->getCc(), $email->getBcc()), true));
9090
}
9191

9292
protected function getAttachments(Email $email): array
9393
{
9494
$attachments = [];
9595
foreach ($email->getAttachments() as $attachment) {
96+
$fileName = $attachment->getPreparedHeaders()->getHeaderParameter('Content-Disposition', 'filename');
9697
$attachments[] = [
9798
'@odata.type' => '#microsoft.graph.fileAttachment',
98-
'name' => $attachment->getName(),
99+
'name' => $fileName,
99100
'contentType' => $attachment->getMediaType(),
100101
'contentBytes' => base64_encode($attachment->getBody()),
101102
];

0 commit comments

Comments
 (0)