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:
parent
eda8439f02
commit
881aa4add9
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user