mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 16:31:33 +02: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();
|
$this->recurring_invoice->save();
|
||||||
|
|
||||||
//Admin notification for recurring invoice sent.
|
//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');
|
$invoice->entityEmailEvent($invoice->invitations->first(), 'invoice', 'email_template_invoice');
|
||||||
}
|
}
|
||||||
|
|
||||||
nlog("Invoice {$invoice->number} created");
|
nlog("Invoice {$invoice->number} created");
|
||||||
|
|
||||||
$invoice->invitations->each(function ($invitation) use ($invoice) {
|
$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{
|
try{
|
||||||
EmailEntity::dispatch($invitation, $invoice->company);
|
EmailEntity::dispatch($invitation, $invoice->company);
|
||||||
|
@ -39,7 +39,7 @@ class UserService
|
|||||||
$nmo->to_user = $this->user;
|
$nmo->to_user = $this->user;
|
||||||
$nmo->settings = $company->settings;
|
$nmo->settings = $company->settings;
|
||||||
|
|
||||||
NinjaMailerJob::dispatch($nmo);
|
NinjaMailerJob::dispatch($nmo, true);
|
||||||
|
|
||||||
Ninja::registerNinjaUser($this->user);
|
Ninja::registerNinjaUser($this->user);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user