mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 05:14:37 -04:00
Additional checks for checkdata
This commit is contained in:
parent
2c2d2b91de
commit
6f84b4fdd7
@ -127,7 +127,8 @@ class CheckData extends Command
|
|||||||
$this->checkClientSettings();
|
$this->checkClientSettings();
|
||||||
$this->checkCompanyTokens();
|
$this->checkCompanyTokens();
|
||||||
$this->checkUserState();
|
$this->checkUserState();
|
||||||
|
$this->checkContactEmailAndSendEmailStatus();
|
||||||
|
|
||||||
if (Ninja::isHosted()) {
|
if (Ninja::isHosted()) {
|
||||||
$this->checkAccountStatuses();
|
$this->checkAccountStatuses();
|
||||||
$this->checkNinjaPortalUrls();
|
$this->checkNinjaPortalUrls();
|
||||||
@ -1114,4 +1115,23 @@ class CheckData extends Command
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkContactEmailAndSendEmailStatus()
|
||||||
|
{
|
||||||
|
$q = ClientContact::whereNull('email')
|
||||||
|
->where('send_email', true);
|
||||||
|
|
||||||
|
$this->logMessage($q->count() . " Contacts with Send Email = true but no email address");
|
||||||
|
|
||||||
|
if ($this->option('fix') == 'true') {
|
||||||
|
|
||||||
|
$q->cursor()->each(function ($c){
|
||||||
|
$c->send_email = false;
|
||||||
|
$c->saveQuietly();
|
||||||
|
|
||||||
|
$this->logMessage("Fixing - {$c->id}");
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user