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:
parent
efe3f51778
commit
c64e9cc739
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user