mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #8153 from turbo124/v5-develop
Fixes for client mailers
This commit is contained in:
commit
f66a069cb3
@ -90,7 +90,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
$this->company = Company::where('company_key', $this->nmo->company->company_key)->first();
|
$this->company = Company::where('company_key', $this->nmo->company->company_key)->first();
|
||||||
|
|
||||||
/* If any pre conditions fail, we return early here */
|
/* If any pre conditions fail, we return early here */
|
||||||
if($this->preFlightChecksFail())
|
if(!$this->company || $this->preFlightChecksFail())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Set the email driver */
|
/* Set the email driver */
|
||||||
@ -350,6 +350,9 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
{
|
{
|
||||||
$sending_user = $this->nmo->settings->gmail_sending_user_id;
|
$sending_user = $this->nmo->settings->gmail_sending_user_id;
|
||||||
|
|
||||||
|
if($sending_user == "0")
|
||||||
|
$user = $this->company->owner();
|
||||||
|
else
|
||||||
$user = User::find($this->decodePrimaryKey($sending_user));
|
$user = User::find($this->decodePrimaryKey($sending_user));
|
||||||
|
|
||||||
return $user;
|
return $user;
|
||||||
@ -407,14 +410,6 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
{
|
{
|
||||||
$user = $this->resolveSendingUser();
|
$user = $this->resolveSendingUser();
|
||||||
|
|
||||||
/* Always ensure the user is set on the correct account */
|
|
||||||
// if($user->account_id != $this->company->account_id){
|
|
||||||
|
|
||||||
// $this->nmo->settings->email_sending_method = 'default';
|
|
||||||
// return $this->setMailDriver();
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
$this->checkValidSendingUser($user);
|
$this->checkValidSendingUser($user);
|
||||||
|
|
||||||
nlog("Sending via {$user->name()}");
|
nlog("Sending via {$user->name()}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user