mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Exceptions for emailing when company is deactivated
This commit is contained in:
parent
4326e3d1ca
commit
da6ccddaaf
@ -54,7 +54,9 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
public $nmo;
|
public $nmo;
|
||||||
|
|
||||||
public function __construct(NinjaMailerObject $nmo)
|
public $override;
|
||||||
|
|
||||||
|
public function __construct(NinjaMailerObject $nmo, bool $override = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->nmo = $nmo;
|
$this->nmo = $nmo;
|
||||||
@ -64,7 +66,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
/*If we are migrating data we don't want to fire any emails*/
|
/*If we are migrating data we don't want to fire any emails*/
|
||||||
if ($this->nmo->company->is_disabled)
|
if ($this->nmo->company->is_disabled && !$this->override)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/*Set the correct database*/
|
/*Set the correct database*/
|
||||||
|
@ -56,9 +56,6 @@ class UserEmailChanged implements ShouldQueue
|
|||||||
{
|
{
|
||||||
nlog("notifying user of email change");
|
nlog("notifying user of email change");
|
||||||
|
|
||||||
if ($this->company->is_disabled)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
//Set DB
|
//Set DB
|
||||||
MultiDB::setDb($this->company->db);
|
MultiDB::setDb($this->company->db);
|
||||||
|
|
||||||
@ -78,7 +75,7 @@ class UserEmailChanged implements ShouldQueue
|
|||||||
$nmo->company = $this->company;
|
$nmo->company = $this->company;
|
||||||
$nmo->to_user = $this->old_user;
|
$nmo->to_user = $this->old_user;
|
||||||
|
|
||||||
NinjaMailerJob::dispatch($nmo);
|
NinjaMailerJob::dispatch($nmo, true);
|
||||||
|
|
||||||
// $nmo->to_user = $this->new_user;
|
// $nmo->to_user = $this->new_user;
|
||||||
// NinjaMailerJob::dispatch($nmo);
|
// NinjaMailerJob::dispatch($nmo);
|
||||||
|
@ -209,6 +209,9 @@ class Import implements ShouldQueue
|
|||||||
$this->{$method}($data[$import]);
|
$this->{$method}($data[$import]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Ninja::isHosted())
|
||||||
|
$this->processNinjaTokens($data['ninja_tokens']);
|
||||||
|
|
||||||
$this->setInitialCompanyLedgerBalances();
|
$this->setInitialCompanyLedgerBalances();
|
||||||
|
|
||||||
// $this->fixClientBalances();
|
// $this->fixClientBalances();
|
||||||
@ -1636,6 +1639,10 @@ class Import implements ShouldQueue
|
|||||||
return $response->getBody();
|
return $response->getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function processNinjaTokens(array $data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* In V4 we use negative invoices (credits) and add then into the client balance. In V5, these sit off ledger and are applied later.
|
/* In V4 we use negative invoices (credits) and add then into the client balance. In V5, these sit off ledger and are applied later.
|
||||||
This next section will check for credit balances and reduce the client balance so that the V5 balances are correct
|
This next section will check for credit balances and reduce the client balance so that the V5 balances are correct
|
||||||
|
Loading…
x
Reference in New Issue
Block a user