PDF Reports
This commit is contained in:
parent
ca8889b207
commit
bb5e71dcf6
|
|
@ -76,8 +76,13 @@ class SendToAdmin implements ShouldQueue
|
||||||
$nmo->company = $this->company;
|
$nmo->company = $this->company;
|
||||||
$nmo->settings = $this->company->settings;
|
$nmo->settings = $this->company->settings;
|
||||||
$nmo->to_user = $user;
|
$nmo->to_user = $user;
|
||||||
|
|
||||||
|
try {
|
||||||
|
(new NinjaMailerJob($nmo))->handle();
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
nlog("EXCEPTION:: SendToAdmin:: could not email report for" . $th->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
NinjaMailerJob::dispatch($nmo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function middleware()
|
public function middleware()
|
||||||
|
|
|
||||||
|
|
@ -120,12 +120,18 @@ class EmailReport
|
||||||
}
|
}
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject();
|
$nmo = new NinjaMailerObject();
|
||||||
$nmo->mailable = new DownloadReport($this->scheduler->company, $files);
|
$nmo->mailable = new DownloadReport($this->scheduler->company->withoutRelations(), $files);
|
||||||
$nmo->company = $this->scheduler->company;
|
$nmo->company = $this->scheduler->company->withoutRelations();
|
||||||
$nmo->settings = $this->scheduler->company->settings;
|
$nmo->settings = $this->scheduler->company->settings;
|
||||||
$nmo->to_user = $this->scheduler->user;
|
$nmo->to_user = $this->scheduler->user->withoutRelations();
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
(new NinjaMailerJob($nmo))->handle();
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
nlog("EXCEPTION:: EmailReport:: could not email report for schdule {$this->scheduler->id} ". $th->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
NinjaMailerJob::dispatch($nmo);
|
|
||||||
|
|
||||||
//calculate next run dates;
|
//calculate next run dates;
|
||||||
$this->scheduler->calculateNextRun();
|
$this->scheduler->calculateNextRun();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue