1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

place check whether a recurring invoice should be automatically sent

This commit is contained in:
David Bomba 2021-08-03 07:01:28 +10:00
parent efe3f51778
commit c64e9cc739
2 changed files with 3 additions and 3 deletions

View File

@ -86,14 +86,14 @@ class SendRecurring implements ShouldQueue
$this->recurring_invoice->save();
//Admin notification for recurring invoice sent.
if ($invoice->invitations->count() >= 1) {
if ($invoice->invitations->count() >= 1 ) {
$invoice->entityEmailEvent($invoice->invitations->first(), 'invoice', 'email_template_invoice');
}
nlog("Invoice {$invoice->number} created");
$invoice->invitations->each(function ($invitation) use ($invoice) {
if ($invitation->contact && strlen($invitation->contact->email) >=1) {
if ($invitation->contact && strlen($invitation->contact->email) >=1 && $invoice->client->getSetting('auto_email_invoice')) {
try{
EmailEntity::dispatch($invitation, $invoice->company);

View File

@ -39,7 +39,7 @@ class UserService
$nmo->to_user = $this->user;
$nmo->settings = $company->settings;
NinjaMailerJob::dispatch($nmo);
NinjaMailerJob::dispatch($nmo, true);
Ninja::registerNinjaUser($this->user);