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:
parent
67d0f525af
commit
c7048e8cb1
@ -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);
|
||||||
});
|
});
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user