diff --git a/app/Services/Email/EmailDefaults.php b/app/Services/Email/EmailDefaults.php index 9d225c4cc310..071541ad9dda 100644 --- a/app/Services/Email/EmailDefaults.php +++ b/app/Services/Email/EmailDefaults.php @@ -168,7 +168,7 @@ class EmailDefaults */ private function setBody(): self { - + if (strlen($this->email->email_object->body) > 3) { // A Custom Message has been set in the email screen. // return $this; @@ -181,7 +181,7 @@ class EmailDefaults } $this->email->email_object->text_body = strip_tags($this->email->email_object->body); - + if ($this->template == 'email.template.custom') { $this->email->email_object->body = (str_replace('$body', $this->email->email_object->body, str_replace(["\r","\n"], "", $this->email->email_object->settings->email_style_custom))); } @@ -230,7 +230,7 @@ class EmailDefaults $this->email->email_object->subject = strtr($this->email->email_object->subject, $this->email->email_object->variables); - + //06-06-2023 ensure we do not parse markdown in custom templates if ($this->template != 'custom' && $this->template != 'email.template.custom') { $this->email->email_object->body = $this->parseMarkdownToHtml($this->email->email_object->body); @@ -303,17 +303,6 @@ class EmailDefaults $this->email->email_object->entity instanceof Quote || $this->email->email_object->entity instanceof Credit)) { $pdf = ((new CreateRawPdf($this->email->email_object->invitation, $this->email->company->db))->handle()); - if ($this->email->email_object->settings->enable_e_invoice && $this->email->email_object->entity instanceof Invoice) { - - $xinvoice_path = $this->email->email_object->entity->service()->getEInvoice(); - - if(Storage::disk(config('filesystems.default'))->exists($xinvoice_path)) - $this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode(Storage::get($xinvoice_path)), 'name' => explode(".", $this->email->email_object->entity->getFileName('xml'))[0]."-xinvoice.xml"]]); - - } - else { - $this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]); - } $this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]); }