mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for custom email template
This commit is contained in:
parent
eda8439f02
commit
881aa4add9
@ -144,8 +144,6 @@ class PaytracePaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
$response = $this->gatewayRequest('/v1/transactions/sale/by_customer', $data);
|
$response = $this->gatewayRequest('/v1/transactions/sale/by_customer', $data);
|
||||||
|
|
||||||
nlog($response);
|
|
||||||
|
|
||||||
if ($response && $response->success) {
|
if ($response && $response->success) {
|
||||||
$data = [
|
$data = [
|
||||||
'gateway_type_id' => $cgt->gateway_type_id,
|
'gateway_type_id' => $cgt->gateway_type_id,
|
||||||
|
@ -168,14 +168,10 @@ class EmailDefaults
|
|||||||
*/
|
*/
|
||||||
private function setBody(): self
|
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));
|
if (strlen($this->email->email_object->body) > 3) {
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->email->email_object->body) {
|
|
||||||
// A Custom Message has been set in the email screen.
|
// 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) {
|
} elseif (strlen($this->email->email_object->settings?->{$this->email->email_object->email_template_body}) > 3) {
|
||||||
// A body has been saved in the settings.
|
// 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};
|
$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
|
// Default template to be used
|
||||||
$this->email->email_object->body = EmailTemplateDefaults::getDefaultTemplate($this->email->email_object->email_template_body, $this->locale);
|
$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;
|
return $this;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user