mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Adapt templates for dynamic emails
This commit is contained in:
parent
2bc83aff27
commit
01e7e3271e
@ -49,7 +49,8 @@ class TemplateEmail extends Mailable
|
||||
|
||||
public function build()
|
||||
{
|
||||
$template_name = 'email.template.'.$this->build_email->getTemplate();
|
||||
// $template_name = 'email.template.'.$this->build_email->getTemplate();
|
||||
$template_name = 'email.template.client';
|
||||
|
||||
if($this->build_email->getTemplate() == 'custom') {
|
||||
$this->build_email->setBody(str_replace('$body', $this->build_email->getBody(), $this->client->getSetting('email_style_custom')));
|
||||
@ -100,6 +101,7 @@ class TemplateEmail extends Mailable
|
||||
'settings' => $settings,
|
||||
'company' => $company,
|
||||
'whitelabel' => $this->client->user->account->isPaid() ? true : false,
|
||||
'logo' => $this->company->present()->logo(),
|
||||
])
|
||||
->withSwiftMessage(function ($message) use($company){
|
||||
$message->getHeaders()->addTextHeader('Tag', $company->company_key);
|
||||
|
@ -194,6 +194,7 @@ class TemplateEngine
|
||||
$data['title'] = '';
|
||||
$data['body'] = '$body';
|
||||
$data['footer'] = '';
|
||||
$data['logo'] = auth()->user()->company()->present()->logo();
|
||||
|
||||
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
||||
|
||||
@ -211,11 +212,17 @@ class TemplateEngine
|
||||
} else {
|
||||
$wrapper = '';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
elseif ($email_style == 'plain') {
|
||||
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
|
||||
$injection = '';
|
||||
$wrapper = str_replace('<head>', $injection, $wrapper);
|
||||
}
|
||||
else {
|
||||
$wrapper = view($this->getTemplatePath('client'), $data)->render();
|
||||
$injection = '';
|
||||
$wrapper = str_replace('<head>', $injection, $wrapper);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'subject' => $this->subject,
|
||||
|
@ -119,7 +119,8 @@
|
||||
<div style="border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding: 20px;" id="content">
|
||||
<div style="padding-top: 10px;"></div>
|
||||
|
||||
{{ $slot}}
|
||||
{{ $slot ?? '' }}
|
||||
{!! $body ?? '' !!}
|
||||
|
||||
<div>
|
||||
<a href="#"
|
||||
|
Loading…
x
Reference in New Issue
Block a user