@@ -55,18 +55,18 @@ protected function doSend(SentMessage $message): void
55
55
}
56
56
57
57
/**
58
- * @param Collection<Address> $recipients
58
+ * @param Collection<Address> $recipients
59
59
* @return array
60
60
*/
61
61
protected function transformEmailAddresses (Collection $ recipients ): array
62
62
{
63
63
return $ recipients
64
- ->map (fn (Address $ recipient ) => $ this ->transformEmailAddress ($ recipient ))
64
+ ->map (fn (Address $ recipient ) => $ this ->transformEmailAddress ($ recipient ))
65
65
->toArray ();
66
66
}
67
67
68
68
/**
69
- * @param Address $address
69
+ * @param Address $address
70
70
* @return array
71
71
*/
72
72
protected function transformEmailAddress (Address $ address ): array
@@ -79,23 +79,24 @@ protected function transformEmailAddress(Address $address): array
79
79
}
80
80
81
81
/**
82
- * @param Email $email
83
- * @param Envelope $envelope
82
+ * @param Email $email
83
+ * @param Envelope $envelope
84
84
* @return Collection<Address>
85
85
*/
86
86
protected function getRecipients (Email $ email , Envelope $ envelope ): Collection
87
87
{
88
88
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 ));
90
90
}
91
91
92
92
protected function getAttachments (Email $ email ): array
93
93
{
94
94
$ attachments = [];
95
95
foreach ($ email ->getAttachments () as $ attachment ) {
96
+ $ fileName = $ attachment ->getPreparedHeaders ()->getHeaderParameter ('Content-Disposition ' , 'filename ' );
96
97
$ attachments [] = [
97
98
'@odata.type ' => '#microsoft.graph.fileAttachment ' ,
98
- 'name ' => $ attachment -> getName () ,
99
+ 'name ' => $ fileName ,
99
100
'contentType ' => $ attachment ->getMediaType (),
100
101
'contentBytes ' => base64_encode ($ attachment ->getBody ()),
101
102
];
0 commit comments