From 3417b1ff0f5cc0aa2840e752f130243efda424af Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 7 Jan 2022 11:54:12 +1100 Subject: [PATCH] Fixes for send_email triggered action not generating PDFs in time. --- app/Services/Credit/TriggeredActions.php | 1 + app/Services/Invoice/TriggeredActions.php | 2 +- app/Services/Quote/TriggeredActions.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Services/Credit/TriggeredActions.php b/app/Services/Credit/TriggeredActions.php index 28134972af..cfc10e2d28 100644 --- a/app/Services/Credit/TriggeredActions.php +++ b/app/Services/Credit/TriggeredActions.php @@ -38,6 +38,7 @@ class TriggeredActions extends AbstractService { if ($this->request->has('send_email') && $this->request->input('send_email') == 'true') { + $this->credit = $this->credit->service()->markSent()->save(); $this->sendEmail(); } diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index f9b19f4b1b..2636a5376f 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -49,7 +49,7 @@ class TriggeredActions extends AbstractService } if ($this->request->has('send_email') && $this->request->input('send_email') == 'true') { - $this->invoice->service()->touchPdf()->save(); + $this->invoice->service()->markSent()->touchPdf()->save(); $this->sendEmail(); } diff --git a/app/Services/Quote/TriggeredActions.php b/app/Services/Quote/TriggeredActions.php index fa630d753f..ea38a696c5 100644 --- a/app/Services/Quote/TriggeredActions.php +++ b/app/Services/Quote/TriggeredActions.php @@ -38,6 +38,7 @@ class TriggeredActions extends AbstractService { if ($this->request->has('send_email') && $this->request->input('send_email') == 'true') { + $this->quote = $this->quote->service()->markSent()->save(); $this->sendEmail(); }