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
274274
275275 $ attachmentArray = [];
276276 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 {
277284 $ path = pathinfo ($ file );
278285
279286 $ 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 )),
284291 ];
292+ }
285293 }
286294
287295 $ singleValueExtendedPropertiesarray = [];
You can’t perform that action at this time.
0 commit comments