1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 06:32:40 +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)); $user = User::find($this->decodePrimaryKey($sending_user));
nlog("Sending via {$user->present()->name()}"); nlog("Sending via {$user->name()}");
$google = (new Google())->init(); $google = (new Google())->init();
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token)); $google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
@ -164,7 +164,7 @@ class NinjaMailerJob implements ShouldQueue
$this->nmo $this->nmo
->mailable ->mailable
->from($user->email, $user->present()->name()) ->from($user->email, $user->name())
->withSwiftMessage(function ($message) use($token) { ->withSwiftMessage(function ($message) use($token) {
$message->getHeaders()->addTextHeader('GmailToken', $token); $message->getHeaders()->addTextHeader('GmailToken', $token);
}); });

View File

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