mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for email templates not displaying css correctly
This commit is contained in:
parent
6ca8bb95bd
commit
81a34f3446
@ -119,7 +119,9 @@ class EmailTemplateDefaults
|
|||||||
'allow_unsafe_links' => false,
|
'allow_unsafe_links' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $converter->convertToHtml(self::transformText('invoice_message'));
|
$invoice_message = '<p>' . self::transformText('invoice_message') . '</p><br><br><p>$view_link</p>';
|
||||||
|
return $invoice_message;
|
||||||
|
//return $converter->convertToHtml($invoice_message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ use App\Utils\TemplateEngine;
|
|||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
use App\Utils\Traits\MakesTemplateData;
|
use App\Utils\Traits\MakesTemplateData;
|
||||||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
use League\CommonMark\CommonMarkConverter;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
|
|
||||||
class TemplateController extends BaseController
|
class TemplateController extends BaseController
|
||||||
@ -93,6 +94,8 @@ class TemplateController extends BaseController
|
|||||||
|
|
||||||
$data = (new TemplateEngine($body, $subject, $entity, $entity_id, $template))->build();
|
$data = (new TemplateEngine($body, $subject, $entity, $entity_id, $template))->build();
|
||||||
|
|
||||||
|
|
||||||
return response()->json($data, 200);
|
return response()->json($data, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,12 @@ class BaseNotification extends Notification implements ShouldQueue
|
|||||||
case 'custom':
|
case 'custom':
|
||||||
return 'email.template.custom';
|
return 'email.template.custom';
|
||||||
break;
|
break;
|
||||||
|
case 'light':
|
||||||
|
return 'email.template.light';
|
||||||
|
break;
|
||||||
|
case 'dark':
|
||||||
|
return 'email.template.dark';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return 'email.admin.generic_email';
|
return 'email.admin.generic_email';
|
||||||
break;
|
break;
|
||||||
|
@ -77,8 +77,8 @@ class SendGenericNotification extends BaseNotification implements ShouldQueue
|
|||||||
$mail_message = (new MailMessage)
|
$mail_message = (new MailMessage)
|
||||||
->withSwiftMessage(function ($message) {
|
->withSwiftMessage(function ($message) {
|
||||||
$message->getHeaders()->addTextHeader('Tag', $this->invitation->company->company_key);
|
$message->getHeaders()->addTextHeader('Tag', $this->invitation->company->company_key);
|
||||||
//})->markdown($this->getTemplateView(), $this->buildMailMessageData());
|
})->markdown($this->getTemplateView(), $this->buildMailMessageData());
|
||||||
})->markdown('email.template.plain', $this->buildMailMessageData());
|
//})->markdown('email.template.plain', $this->buildMailMessageData());
|
||||||
|
|
||||||
$mail_message = $this->buildMailMessageSettings($mail_message);
|
$mail_message = $this->buildMailMessageSettings($mail_message);
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ class TemplateEngine
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$this->body = $converter->convertToHtml($this->body);
|
$this->body = $converter->convertToHtml($this->body);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function entityValues($contact)
|
private function entityValues($contact)
|
||||||
@ -165,10 +166,12 @@ class TemplateEngine
|
|||||||
$wrapper = '';
|
$wrapper = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$wrapper = $this->getTemplate();
|
|
||||||
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
|
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
|
||||||
|
$injection = '<head><link rel="stylesheet" type="text/css" property="stylesheet" href="'.config('ninja.app_url').'/css/tailwind-1.2.0.css">';
|
||||||
|
$wrapper = str_replace('<head>',$injection ,$wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info($this->body);
|
||||||
$data = [
|
$data = [
|
||||||
'subject' => $this->subject,
|
'subject' => $this->subject,
|
||||||
'body' => $this->body,
|
'body' => $this->body,
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</h1>
|
</h1>
|
||||||
@isset($p)
|
@isset($p)
|
||||||
<p>{{ $p }}</p>
|
{!! $p !!}
|
||||||
@endisset
|
@endisset
|
||||||
</div>
|
</div>
|
@ -26,13 +26,13 @@
|
|||||||
{{ $header }}
|
{{ $header }}
|
||||||
<div id="text" class="px-10 py-6 flex flex-col">
|
<div id="text" class="px-10 py-6 flex flex-col">
|
||||||
@isset($greeting)
|
@isset($greeting)
|
||||||
<p>{{ $greeting }}</p>
|
{{ $greeting }}
|
||||||
@endisset
|
@endisset
|
||||||
<p>
|
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</p>
|
|
||||||
@isset($signature)
|
@isset($signature)
|
||||||
<p>{{ $signature }}</p>
|
{{ $signature }}
|
||||||
@endisset
|
@endisset
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ App::getLocale() }}">
|
<html lang="{{ App::getLocale() }}" class="bg-white">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body class="bg-white">
|
||||||
{!! $body !!}
|
{!! $body !!}
|
||||||
</body>
|
</body>
|
||||||
<footer>
|
<footer>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user