From eb04382757fbbb496f24bdaa52d483b2664b131a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 23 Nov 2024 17:22:47 +1100 Subject: [PATCH] Updates for quote reminders --- app/Services/Quote/SendEmail.php | 8 ++++---- openapi/api-docs.yaml | 18 +++++++++++++++++- openapi/paths.yaml | 18 +++++++++++++++++- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/app/Services/Quote/SendEmail.php b/app/Services/Quote/SendEmail.php index 5dd0aad3dc..a972c55d02 100644 --- a/app/Services/Quote/SendEmail.php +++ b/app/Services/Quote/SendEmail.php @@ -31,10 +31,10 @@ class SendEmail public function run() { - $this->reminder_template = $this->reminder_template ? "email_template_{$this->reminder_template}" : "email_template_".$this->quote->calculateTemplate('quote'); - // if (! $this->reminder_template) { - // $this->reminder_template = $this->quote->calculateTemplate('quote'); - // } + if(in_array($this->reminder_template, ["email_quote_template_reminder1","reminder1"])); + $this->reminder_template = "email_quote_template_reminder1"; + else + $this->reminder_template = "email_template_".$this->quote->calculateTemplate('quote'); $this->quote->service()->markSent()->save(); diff --git a/openapi/api-docs.yaml b/openapi/api-docs.yaml index e966738909..24fe337b27 100644 --- a/openapi/api-docs.yaml +++ b/openapi/api-docs.yaml @@ -3147,7 +3147,23 @@ paths: template: description: "The template required" type: string - example: invoice,quote,credit,purchase_order,payment,payment_partial,reminder1,reminder2,reminder3,reminder_endless + enum: + - invoice + - quote + - credit + - payment + - payment_partial + - statement + - reminder1 + - reminder2 + - reminder3 + - reminder_endless + - custom1 + - custom2 + - custom3 + - purchase_order + - email_quote_template_reminder1 + example: invoice type: object responses: 200: diff --git a/openapi/paths.yaml b/openapi/paths.yaml index a9866b30ae..a903b3c308 100644 --- a/openapi/paths.yaml +++ b/openapi/paths.yaml @@ -3064,7 +3064,23 @@ paths: template: description: "The template required" type: string - example: invoice,quote,credit,purchase_order,payment,payment_partial,reminder1,reminder2,reminder3,reminder_endless + enum: + - invoice + - quote + - credit + - payment + - payment_partial + - statement + - reminder1 + - reminder2 + - reminder3 + - reminder_endless + - custom1 + - custom2 + - custom3 + - purchase_order + - email_quote_template_reminder1 + example: invoice type: object responses: 200: