mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for plain text emails
This commit is contained in:
parent
77af583f25
commit
e2ed2fa2b2
@ -14,7 +14,6 @@ namespace App\Http\Controllers;
|
||||
use App\Events\Credit\CreditWasEmailed;
|
||||
use App\Events\Quote\QuoteWasEmailed;
|
||||
use App\Http\Requests\Email\SendEmailRequest;
|
||||
use App\Jobs\Entity\EmailEntity;
|
||||
use App\Jobs\PurchaseOrder\PurchaseOrderEmail;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Invoice;
|
||||
@ -30,7 +29,6 @@ use App\Transformers\QuoteTransformer;
|
||||
use App\Transformers\RecurringInvoiceTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Mail\Mailables\Address;
|
||||
|
||||
class EmailController extends BaseController
|
||||
|
@ -180,8 +180,11 @@ class EmailDefaults
|
||||
$this->email->email_object->body = EmailTemplateDefaults::getDefaultTemplate($this->email->email_object->email_template_body, $this->locale);
|
||||
}
|
||||
|
||||
$this->email->email_object->text_body = strip_tags($this->email->email_object->body);
|
||||
|
||||
$breaks = ["<br />","<br>","<br/>"];
|
||||
$this->email->email_object->text_body = str_ireplace($breaks, "\r\n", $this->email->email_object->body);
|
||||
$this->email->email_object->text_body = strip_tags($this->email->email_object->text_body);
|
||||
$this->email->email_object->text_body = str_replace('$view_button', '$view_url', $this->email->email_object->text_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)));
|
||||
}
|
||||
@ -226,7 +229,10 @@ class EmailDefaults
|
||||
*/
|
||||
public function setVariables(): self
|
||||
{
|
||||
|
||||
$this->email->email_object->body = strtr($this->email->email_object->body, $this->email->email_object->variables);
|
||||
|
||||
$this->email->email_object->text_body = strtr($this->email->email_object->text_body, $this->email->email_object->variables);
|
||||
|
||||
$this->email->email_object->subject = strtr($this->email->email_object->subject, $this->email->email_object->variables);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user