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