mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 00:17:34 -05:00 
			
		
		
		
	Fixes for paths for email attachments
This commit is contained in:
		
							parent
							
								
									b9858306f9
								
							
						
					
					
						commit
						238143d88e
					
				@ -160,6 +160,9 @@ class ConnectedAccountController extends BaseController
 | 
			
		||||
                'email_verified_at' =>now()
 | 
			
		||||
            ];
 | 
			
		||||
 | 
			
		||||
            if(auth()->user()->email != $google->harvestEmail($user))
 | 
			
		||||
                return response()->json(['message' => 'Primary Email differs to OAuth email. Emails must match.'], 400);
 | 
			
		||||
 | 
			
		||||
            auth()->user()->update($connected_account);
 | 
			
		||||
            auth()->user()->email_verified_at = now();
 | 
			
		||||
            auth()->user()->save();
 | 
			
		||||
 | 
			
		||||
@ -43,6 +43,9 @@ class InvoiceEmailFailedActivity implements ShouldQueue
 | 
			
		||||
        
 | 
			
		||||
        MultiDB::setDb($event->company->db);
 | 
			
		||||
 | 
			
		||||
        if(strpos($event->message, 'shared/public') !== false)
 | 
			
		||||
            $event->message = "Unable to open attachment file for reading"; 
 | 
			
		||||
 | 
			
		||||
        $fields = new stdClass;
 | 
			
		||||
 | 
			
		||||
        $fields->invoice_id = $event->invitation->invoice->id;
 | 
			
		||||
 | 
			
		||||
@ -95,9 +95,12 @@ class CreditEmailEngine extends BaseEmailEngine
 | 
			
		||||
            ->setInvitation($this->invitation);
 | 
			
		||||
 | 
			
		||||
        if ($this->client->getSetting('pdf_email_attachment') !== false && $this->credit->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
 | 
			
		||||
            $this->setAttachments([$this->credit->pdf_file_path()]);
 | 
			
		||||
 | 
			
		||||
            // $this->setAttachments(['path' => $this->credit->pdf_file_path(), 'name' => basename($this->credit->pdf_file_path())]);
 | 
			
		||||
            if(Ninja::isHosted())
 | 
			
		||||
                $this->setAttachments([$this->credit->pdf_file_path(null, 'url', true)]);
 | 
			
		||||
            else
 | 
			
		||||
                $this->setAttachments([$this->credit->pdf_file_path()]);
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //attach third party documents
 | 
			
		||||
 | 
			
		||||
@ -106,7 +106,12 @@ class InvoiceEmailEngine extends BaseEmailEngine
 | 
			
		||||
            ->setInvitation($this->invitation);
 | 
			
		||||
 | 
			
		||||
        if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
 | 
			
		||||
            $this->setAttachments([$this->invoice->pdf_file_path()]);
 | 
			
		||||
 | 
			
		||||
            if(Ninja::isHosted())
 | 
			
		||||
                $this->setAttachments([$this->invoice->pdf_file_path(null, 'url', true)]);
 | 
			
		||||
            else
 | 
			
		||||
                $this->setAttachments([$this->invoice->pdf_file_path()]);
 | 
			
		||||
 | 
			
		||||
            // $this->setAttachments(['path' => $this->invoice->pdf_file_path(), 'name' => basename($this->invoice->pdf_file_path())]);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -97,8 +97,11 @@ class QuoteEmailEngine extends BaseEmailEngine
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if ($this->client->getSetting('pdf_email_attachment') !== false && $this->quote->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
 | 
			
		||||
            $this->setAttachments([$this->quote->pdf_file_path()]);
 | 
			
		||||
            //$this->setAttachments(['path' => $this->quote->pdf_file_path(), 'name' => basename($this->quote->pdf_file_path())]);
 | 
			
		||||
 | 
			
		||||
            if(Ninja::isHosted())
 | 
			
		||||
                $this->setAttachments([$this->quote->pdf_file_path(null, 'url', true)]);
 | 
			
		||||
            else
 | 
			
		||||
                $this->setAttachments([$this->quote->pdf_file_path()]);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -74,15 +74,15 @@ class UpdatePaymentMethods
 | 
			
		||||
                    $this->addOrUpdateCard($method, $token, GatewayType::SOFORT);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                $bank_accounts = Customer::allSources(
 | 
			
		||||
                    $token->gateway_customer_reference,
 | 
			
		||||
                    ['object' => 'bank_account', 'limit' => 300]
 | 
			
		||||
                );
 | 
			
		||||
                // $bank_accounts = Customer::allSources(
 | 
			
		||||
                //     $token->gateway_customer_reference,
 | 
			
		||||
                //     ['object' => 'bank_account', 'limit' => 300]
 | 
			
		||||
                // );
 | 
			
		||||
 | 
			
		||||
                foreach($bank_accounts as $bank_account)
 | 
			
		||||
                {
 | 
			
		||||
                    $this->addOrUpdateBankAccount($bank_account, $token);
 | 
			
		||||
                }
 | 
			
		||||
                // foreach($bank_accounts as $bank_account)
 | 
			
		||||
                // {
 | 
			
		||||
                //     $this->addOrUpdateBankAccount($bank_account, $token);
 | 
			
		||||
                // }
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user