From 7907eae103cfc7b752a133d5618e3f589416565f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 19 Jan 2021 11:46:00 +1100 Subject: [PATCH] raw subject and raw body --- app/Utils/TemplateEngine.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Utils/TemplateEngine.php b/app/Utils/TemplateEngine.php index 898a3044650c..81a3c936f48c 100644 --- a/app/Utils/TemplateEngine.php +++ b/app/Utils/TemplateEngine.php @@ -44,6 +44,10 @@ class TemplateEngine private $settings; + private $raw_body; + + private $raw_subject; + public function __construct($body, $subject, $entity, $entity_id, $template) { $this->body = $body; @@ -121,6 +125,9 @@ class TemplateEngine private function replaceValues() { + $this->raw_body = $this->body; + $this->raw_subject = $this->subject; + if ($this->entity_obj) { $this->entityValues($this->entity_obj->client->primary_contact()->first()); } else { @@ -157,6 +164,7 @@ class TemplateEngine $this->body = strtr($this->body, $data['values']); $this->body = str_replace("\n", "
", $this->body); + $this->subject = strtr($this->subject, $data['labels']); $this->subject = strtr($this->subject, $data['values']); @@ -197,9 +205,10 @@ class TemplateEngine 'subject' => $this->subject, 'body' => $this->body, 'wrapper' => $wrapper, + 'raw_body' => $this->raw_body, + 'raw_subject' => $this->raw_subject ]; - - + $this->tearDown(); return $data;