Fixes for email templates

This commit is contained in:
David Bomba 2024-02-02 05:55:59 +11:00
parent b7b2fc5897
commit 894d675e2a
2 changed files with 1 additions and 3 deletions

View File

@ -78,7 +78,6 @@ class AppServiceProvider extends ServiceProvider
->middleware('client');
});
/* Ensure we don't have stale state in jobs */
Queue::before(function (JobProcessing $event) {
App::forgetInstance('truthsource');
@ -107,7 +106,6 @@ class AppServiceProvider extends ServiceProvider
return $this;
});
Mailer::macro('mailgun_config', function (string $secret, string $domain, string $endpoint = 'api.mailgun.net') {
// @phpstan-ignore /** @phpstan-ignore-next-line **/
Mailer::setSymfonyTransport(app('mail.manager')->createSymfonyTransport([

View File

@ -177,7 +177,7 @@ class EmailDefaults
$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);
$this->email->email_object->text_body = str_replace(['$view_button','$viewButton'], '$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)));