Samson Mutunga 7 tháng trước cách đây
mục cha
commit
5388087958
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      app/Http/Services/EmailService.php

+ 5 - 4
app/Http/Services/EmailService.php

@@ -37,7 +37,7 @@ class EmailService
         if($attachment){
             $response =   Http::asMultipart()
             ->attach(
-                $attachment['name'],
+                $attachment['fileName'],
                 $attachment['contents'],
                 $attachment['name']
             )
@@ -260,12 +260,13 @@ class EmailService
         $response = $this->callJava('/api/email/send', $emailParams, null, $attachment);
     }
 
-    protected function getAttachmentFromStoragePath($path, $name){
+    protected function getAttachmentFromStoragePath($path, $fileName){
         if (Storage::exists($path)) {
             return [
-                'name' => $name,
+                'fileName' => $fileName,
+                'name' => basename($path),
                 'contents' => Storage::get($path),
-                'mime' => Storage::mimeType($path)
+                'mime' => Storage::mimeType($path),
             ];
         }