1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for user present name

This commit is contained in:
David Bomba 2021-02-22 20:54:46 +11:00
parent 67d0f525af
commit c7048e8cb1
2 changed files with 8 additions and 2 deletions

View File

@ -142,7 +142,7 @@ class NinjaMailerJob implements ShouldQueue
$user = User::find($this->decodePrimaryKey($sending_user));
nlog("Sending via {$user->present()->name()}");
nlog("Sending via {$user->name()}");
$google = (new Google())->init();
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
@ -164,7 +164,7 @@ class NinjaMailerJob implements ShouldQueue
$this->nmo
->mailable
->from($user->email, $user->present()->name())
->from($user->email, $user->name())
->withSwiftMessage(function ($message) use($token) {
$message->getHeaders()->addTextHeader('GmailToken', $token);
});

View File

@ -103,6 +103,12 @@ class User extends Authenticatable implements MustVerifyEmail
'deleted_at' => 'timestamp',
];
public function name()
{
return $this->first_name . ' ' . $this->last_name;
}
public function getEntityType()
{
return self::class;