1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Refactor emails to plain CSS + table structure

This commit is contained in:
Benjamin Beganović 2021-01-18 15:25:51 +01:00
parent a00f463371
commit 4c34bc2177
4 changed files with 57 additions and 73 deletions

View File

@ -1,14 +1,3 @@
<div id="header" class="border-b {{ isset($logo) ? 'p-6' : '' }} flex justify-center"> @isset($logo)
@isset($logo) <img src="{{ $logo }}" style="height: 4rem;">
<img src="{{ $logo }}" style="height: 6rem;"> @endisset
@endisset
</div>
<div class="flex flex-col items-center mt-8 mb-4">
<h1 id="title" class="text-2xl md:text-3xl mt-5">
{{ $slot }}
</h1>
@isset($p)
{!! $p !!}
@endisset
</div>

View File

@ -1,22 +1,15 @@
@component('email.template.master', ['design' => 'dark', 'settings' => $settings, 'whitelabel' => $whitelabel]) @component('email.template.master', ['design' => 'dark', 'settings' => $settings, 'whitelabel' => $whitelabel])
@slot('header') @slot('header')
@component('email.components.header', ['p' => $body, 'logo' => (strlen($settings->company_logo) > 1) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png']) @include('email.components.header', ['logo' => (strlen($settings->company_logo) > 1) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@endslot
@if(isset($title)) {!! $body !!}
{{$title}}
@slot('below_card')
@if($signature)
{{ $signature }}
@endif @endif
@endslot
@endcomponent
@if($footer)
@component('email.components.button', ['url' => $view_link])
{{$view_text}}
@endcomponent
@endif
@endslot
@endcomponent @endcomponent

View File

@ -1,30 +1,15 @@
@component('email.template.master', ['design' => 'light', 'settings' => $settings, 'whitelabel' => $whitelabel]) @component('email.template.master', ['design' => 'light', 'settings' => $settings, 'whitelabel' => $whitelabel])
@slot('header') @slot('header')
@component('email.components.header', ['p' => $body, 'logo' => (strlen($settings->company_logo) > 1) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png']) @include('email.components.header', ['logo' => (strlen($settings->company_logo) > 1) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@if(isset($title))
{{$title}}
@endif
@endcomponent
@if($footer)
@component('email.components.button', ['url' => $view_link])
{{$view_text}}
@endcomponent
@endif
@endslot @endslot
@slot('below_card') {!! $body !!}
@slot('below_card')
@if($signature) @if($signature)
{{ $signature }} {{ $signature }}
@endif @endif
@endslot @endslot
@endcomponent @endcomponent

View File

@ -1,30 +1,47 @@
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html lang="{{ App::getLocale() }}" class="bg-white"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head> <head>
<meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Invoice Ninja</title>
</head> </head>
<body class="bg-white p-4"> <body>
{!! $body !!} <table role="presentation" cellpadding="0" cellspacing="0" width="100%">
<tr>
@if($signature) <td style="font-family: Arial, sans-serif, 'Open Sans'">
<div style="margin-top: 20px"> <table cellpadding="0" cellspacing="0" width="100%">
{!! $signature !!} <tr>
</div> <td>
@endif <table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td id="email-content">
{!! $body !!}
</td>
</tr>
</table>
</td>
</tr>
<tr>
@isset($whitelabel)
@if(!$whitelabel)
<td>
<p>
<a href="https://invoiceninja.com" target="_blank">
{{ __('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }}
</a>
</p>
</td>
@endif
@endif
</tr>
</table>
</td>
</tr>
</table>
</body> </body>
<footer class="p-4">
{!! $footer !!}
</footer>
@if(!$whitelabel)
<div style="display: block; margin-top: 1rem; margin-bottom: 1rem;">
<a href="https://invoiceninja.com" target="_blank">
{{ __('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }}
</a>
</div>
@endif
</html> </html>