mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for client emails
This commit is contained in:
parent
c075a81326
commit
7a9baae85b
@ -48,7 +48,15 @@ class ClientPresenter extends EntityPresenter
|
|||||||
|
|
||||||
public function email()
|
public function email()
|
||||||
{
|
{
|
||||||
return $this->entity->primary_contact->first() !== null ? $this->entity->primary_contact->first()->email : 'No Email Set';
|
$primary_contact = $this->entity->primary_contact->first();
|
||||||
|
|
||||||
|
if($primary_contact && strlen($primary_contact->email) > 1)
|
||||||
|
return $primary_contact->email;
|
||||||
|
|
||||||
|
$contact = $this->entity->contacts->whereNotNull('email')->first();
|
||||||
|
|
||||||
|
return $contact ? $contact->email : 'No Email Set';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function address()
|
public function address()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user