mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 09:24:34 -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()
|
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') {
|
if($this->build_email->getTemplate() == 'custom') {
|
||||||
$this->build_email->setBody(str_replace('$body', $this->build_email->getBody(), $this->client->getSetting('email_style_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,
|
'settings' => $settings,
|
||||||
'company' => $company,
|
'company' => $company,
|
||||||
'whitelabel' => $this->client->user->account->isPaid() ? true : false,
|
'whitelabel' => $this->client->user->account->isPaid() ? true : false,
|
||||||
|
'logo' => $this->company->present()->logo(),
|
||||||
])
|
])
|
||||||
->withSwiftMessage(function ($message) use($company){
|
->withSwiftMessage(function ($message) use($company){
|
||||||
$message->getHeaders()->addTextHeader('Tag', $company->company_key);
|
$message->getHeaders()->addTextHeader('Tag', $company->company_key);
|
||||||
|
@ -194,6 +194,7 @@ class TemplateEngine
|
|||||||
$data['title'] = '';
|
$data['title'] = '';
|
||||||
$data['body'] = '$body';
|
$data['body'] = '$body';
|
||||||
$data['footer'] = '';
|
$data['footer'] = '';
|
||||||
|
$data['logo'] = auth()->user()->company()->present()->logo();
|
||||||
|
|
||||||
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
||||||
|
|
||||||
@ -211,11 +212,17 @@ class TemplateEngine
|
|||||||
} else {
|
} else {
|
||||||
$wrapper = '';
|
$wrapper = '';
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
elseif ($email_style == 'plain') {
|
||||||
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
|
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
|
||||||
$injection = '';
|
$injection = '';
|
||||||
$wrapper = str_replace('<head>', $injection, $wrapper);
|
$wrapper = str_replace('<head>', $injection, $wrapper);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$wrapper = view($this->getTemplatePath('client'), $data)->render();
|
||||||
|
$injection = '';
|
||||||
|
$wrapper = str_replace('<head>', $injection, $wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'subject' => $this->subject,
|
'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="border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding: 20px;" id="content">
|
||||||
<div style="padding-top: 10px;"></div>
|
<div style="padding-top: 10px;"></div>
|
||||||
|
|
||||||
{{ $slot}}
|
{{ $slot ?? '' }}
|
||||||
|
{!! $body ?? '' !!}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="#"
|
<a href="#"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user