1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for custom email template

This commit is contained in:
David Bomba 2023-05-24 14:47:05 +10:00
parent eda8439f02
commit 881aa4add9
2 changed files with 9 additions and 9 deletions

View File

@ -144,8 +144,6 @@ class PaytracePaymentDriver extends BaseDriver
$response = $this->gatewayRequest('/v1/transactions/sale/by_customer', $data);
nlog($response);
if ($response && $response->success) {
$data = [
'gateway_type_id' => $cgt->gateway_type_id,

View File

@ -168,14 +168,10 @@ class EmailDefaults
*/
private function setBody(): self
{
if ($this->template == 'email.template.custom') {
$this->email->email_object->body = (str_replace('$body', $this->email->email_object->body, $this->email->email_object->settings->email_style_custom));
return $this;
}
if ($this->email->email_object->body) {
if (strlen($this->email->email_object->body) > 3) {
// A Custom Message has been set in the email screen.
return $this;
// return $this;
} elseif (strlen($this->email->email_object->settings?->{$this->email->email_object->email_template_body}) > 3) {
// A body has been saved in the settings.
$this->email->email_object->body = $this->email->email_object->settings?->{$this->email->email_object->email_template_body};
@ -183,7 +179,13 @@ class EmailDefaults
// Default template to be used
$this->email->email_object->body = EmailTemplateDefaults::getDefaultTemplate($this->email->email_object->email_template_body, $this->locale);
}
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)));
}
return $this;
}
/**