mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 14:27:29 -04:00 
			
		
		
		
	
						commit
						f3950726dc
					
				| @ -111,6 +111,10 @@ class Handler extends ExceptionHandler | |||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         if (strpos($exception->getMessage(), 'expects parameter 1 to be resource') !== false) { | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -11,6 +11,7 @@ | |||||||
| 
 | 
 | ||||||
| namespace App\Helpers\Mail; | namespace App\Helpers\Mail; | ||||||
| 
 | 
 | ||||||
|  | use App\Utils\TempFile; | ||||||
| use Dacastro4\LaravelGmail\Services\Message\Mail; | use Dacastro4\LaravelGmail\Services\Message\Mail; | ||||||
| use Illuminate\Mail\Transport\Transport; | use Illuminate\Mail\Transport\Transport; | ||||||
| use Swift_Mime_SimpleMessage; | use Swift_Mime_SimpleMessage; | ||||||
| @ -64,8 +65,11 @@ class GmailTransport extends Transport | |||||||
|             nlog("trying to attach"); |             nlog("trying to attach"); | ||||||
|             nlog($child->getContentType()); |             nlog($child->getContentType()); | ||||||
|              |              | ||||||
|             if($child->getContentType() != 'text/plain') |             if($child->getContentType() != 'text/plain'){ | ||||||
|                 $this->gmail->attach($child); | 
 | ||||||
|  |                 $this->gmail->attach(TempFile::filePath($child)); | ||||||
|  |                  | ||||||
|  |             } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         } //todo this should 'just work'
 |         } //todo this should 'just work'
 | ||||||
|  | |||||||
| @ -20,4 +20,16 @@ class TempFile | |||||||
| 
 | 
 | ||||||
|         return $temp_path; |         return $temp_path; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     /* Downloads a file to temp storage and returns the path - used for mailers */ | ||||||
|  |     public static function filePath($data) :string | ||||||
|  |     { | ||||||
|  | 
 | ||||||
|  |         $file_path = sys_get_temp_dir().'/'.sha1(microtime()); | ||||||
|  | 
 | ||||||
|  |         file_put_contents($file_path, $data); | ||||||
|  | 
 | ||||||
|  |         return $file_path; | ||||||
|  | 
 | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user