mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Small fixes for payment email logic
This commit is contained in:
parent
489476feeb
commit
344603123a
@ -58,10 +58,6 @@ class EmailPayment implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if ($this->company->is_disabled || (!$this->contact?->email ?? false)) {
|
||||
nlog("company disabled - or - contact email not found");
|
||||
return;
|
||||
}
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
|
||||
@ -71,6 +67,11 @@ class EmailPayment implements ShouldQueue
|
||||
$this->contact = $this->payment->client->contacts()->orderBy('is_primary', 'desc')->first();
|
||||
}
|
||||
|
||||
if ($this->company->is_disabled || (!$this->contact?->email ?? false)) {
|
||||
nlog("company disabled - or - contact email not found");
|
||||
return;
|
||||
}
|
||||
|
||||
$this->contact->load('client');
|
||||
|
||||
$email_builder = (new PaymentEmailEngine($this->payment, $this->contact))->build();
|
||||
|
Loading…
x
Reference in New Issue
Block a user