File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -274,14 +274,22 @@ protected function prepareEmail(): array
274
274
275
275
$ attachmentArray = [];
276
276
foreach ($ attachments as $ file ) {
277
+ if (array_key_exists ('name ' , $ file ) && array_key_exists ('contentBytes ' , $ file )) {
278
+ $ attachmentArray [] = [
279
+ '@odata.type ' => '#microsoft.graph.fileAttachment ' ,
280
+ 'name ' => $ file ['name ' ],
281
+ 'contentBytes ' => $ file ['contentBytes ' ],
282
+ ];
283
+ } else {
277
284
$ path = pathinfo ($ file );
278
285
279
286
$ attachmentArray [] = [
280
- '@odata.type ' => '#microsoft.graph.fileAttachment ' ,
281
- 'name ' => $ path ['basename ' ],
282
- 'contentType ' => mime_content_type ($ file ),
283
- 'contentBytes ' => base64_encode (file_get_contents ($ file )),
287
+ '@odata.type ' => '#microsoft.graph.fileAttachment ' ,
288
+ 'name ' => $ path ['basename ' ],
289
+ 'contentType ' => mime_content_type ($ file ),
290
+ 'contentBytes ' => base64_encode (file_get_contents ($ file )),
284
291
];
292
+ }
285
293
}
286
294
287
295
$ singleValueExtendedPropertiesarray = [];
You can’t perform that action at this time.
0 commit comments