diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 6c3c941b5f67..6e5f0525344e 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -528,7 +528,7 @@ class NinjaMailerJob implements ShouldQueue */ private function preFlightChecksFail(): bool { - + (new \Modules\Admin\Jobs\Account\EmailQuality($this->nmo, $this->company))->run(); /* If we are migrating data we don't want to fire any emails */ if($this->company->is_disabled && !$this->override) return true; diff --git a/app/Services/Pdf/PdfService.php b/app/Services/Pdf/PdfService.php index fa0bc28ef4fb..46c6c0b8e49f 100644 --- a/app/Services/Pdf/PdfService.php +++ b/app/Services/Pdf/PdfService.php @@ -63,17 +63,10 @@ class PdfService $this->config = (new PdfConfiguration($this))->init(); - $this->html_variables = $this->config->client ? - (new HtmlEngine($invitation))->generateLabelsAndValues() : - (new VendorHtmlEngine($invitation))->generateLabelsAndValues(); - - $this->designer = (new PdfDesigner($this))->build(); - $this->document_type = $document_type; $this->options = $options; - $this->builder = (new PdfBuilder($this))->build(); } /** @@ -120,7 +113,28 @@ class PdfService return $html; } - + + /** + * Initialize all the services to build the PDF + * + * @return self + */ + public function init(): self + { + + $this->html_variables = $this->config->client ? + (new HtmlEngine($this->invitation))->generateLabelsAndValues() : + (new VendorHtmlEngine($this->invitation))->generateLabelsAndValues(); + + $this->designer = (new PdfDesigner($this))->build(); + + + $this->builder = (new PdfBuilder($this))->build(); + + return $this; + + } + /** * resolvePdfEngine *