Merge pull request #4709 from beganovich/v5-1801-refactor-email-templates

(v5) Refactor email templates
This commit is contained in:
Benjamin Beganović 2021-01-19 11:07:39 +01:00 committed by GitHub
commit 5dd38421e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 268 additions and 468 deletions

View File

@ -123,7 +123,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; $data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
$data['$entity.terms'] = ['value' => $this->entity->terms ?: ' ', 'label' => ctrans('texts.invoice_terms')]; $data['$entity.terms'] = ['value' => $this->entity->terms ?: ' ', 'label' => ctrans('texts.invoice_terms')];
$data['$terms'] = &$data['$entity.terms']; $data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')]; $data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')];
} }
@ -132,7 +132,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.quote_number')]; $data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.quote_number')];
$data['$entity.terms'] = ['value' => $this->entity->terms ?: '&nbsp;', 'label' => ctrans('texts.quote_terms')]; $data['$entity.terms'] = ['value' => $this->entity->terms ?: '&nbsp;', 'label' => ctrans('texts.quote_terms')];
$data['$terms'] = &$data['$entity.terms']; $data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a href="'.$this->invitation->getLink().'">'.ctrans('texts.view_quote').'</a>', 'label' => ctrans('texts.view_quote')]; $data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_quote').'</a>', 'label' => ctrans('texts.view_quote')];
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_quote')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_quote')];
} }
@ -141,7 +141,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.credit_number')]; $data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.credit_number')];
$data['$entity.terms'] = ['value' => $this->entity->terms ?: '&nbsp;', 'label' => ctrans('texts.credit_terms')]; $data['$entity.terms'] = ['value' => $this->entity->terms ?: '&nbsp;', 'label' => ctrans('texts.credit_terms')];
$data['$terms'] = &$data['$entity.terms']; $data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a href="'.$this->invitation->getLink().'">'.ctrans('texts.view_credit').'</a>', 'label' => ctrans('texts.view_credit')]; $data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_credit').'</a>', 'label' => ctrans('texts.view_credit')];
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')];
// $data['$view_link'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')]; // $data['$view_link'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')];
} }

View File

@ -38,7 +38,6 @@
"composer/composer": "^2", "composer/composer": "^2",
"czproject/git-php": "^3.17", "czproject/git-php": "^3.17",
"doctrine/dbal": "^2.10", "doctrine/dbal": "^2.10",
"fedeisas/laravel-mail-css-inliner": "^3",
"fideloper/proxy": "^4.2", "fideloper/proxy": "^4.2",
"fzaninotto/faker": "^1.4", "fzaninotto/faker": "^1.4",
"google/apiclient": "^2.7", "google/apiclient": "^2.7",

62
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0afe2d541cb6e16cfb9d29faf3425c2d", "content-hash": "94ab2953278081e3fdf663e1e7cf14c4",
"packages": [ "packages": [
{ {
"name": "asgrim/ofxparser", "name": "asgrim/ofxparser",
@ -1657,66 +1657,6 @@
], ],
"time": "2020-12-29T14:50:06+00:00" "time": "2020-12-29T14:50:06+00:00"
}, },
{
"name": "fedeisas/laravel-mail-css-inliner",
"version": "3.1",
"source": {
"type": "git",
"url": "https://github.com/fedeisas/laravel-mail-css-inliner.git",
"reference": "263f395b46ef9666151ac78daf429632b0b2e2c3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fedeisas/laravel-mail-css-inliner/zipball/263f395b46ef9666151ac78daf429632b0b2e2c3",
"reference": "263f395b46ef9666151ac78daf429632b0b2e2c3",
"shasum": ""
},
"require": {
"ext-dom": "*",
"illuminate/mail": "^7.4 || ^8.0",
"illuminate/support": "^7.4 || ^8.0",
"php": "^7.2.5",
"tijsverkoyen/css-to-inline-styles": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"swiftmailer/swiftmailer": "^6.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Fedeisas\\LaravelMailCssInliner\\LaravelMailCssInlinerServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Fedeisas\\LaravelMailCssInliner\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fede Isas",
"email": "fedeisas@hotmail.com"
}
],
"description": "Inline the CSS of your HTML emails using Laravel",
"keywords": [
"css",
"laravel",
"mailer"
],
"support": {
"issues": "https://github.com/fedeisas/laravel-mail-css-inliner/issues",
"source": "https://github.com/fedeisas/laravel-mail-css-inliner/tree/3.1"
},
"time": "2020-09-12T05:00:14+00:00"
},
{ {
"name": "fideloper/proxy", "name": "fideloper/proxy",
"version": "4.4.1", "version": "4.4.1",

View File

@ -1,22 +1,19 @@
@component('email.template.master', ['design' => 'light']) @component('email.template.master', ['design' => 'light', 'whitelabel' => false])
@slot('header') @slot('header')
@component('email.components.header', ['p' => '', 'logo' => 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png']) @include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
Hello! @endslot
@endcomponent
@endslot <p>You are receiving this email because we received a password reset request for your account.</p>
You are receiving this email because we received a password reset request for your account. <a href="{{ $link }}" target="_blank" class="button">
Reset Password
</a>
@component('email.components.button', ['url' => $link, 'show_link' => true]) <p>
Reset Password If youre having trouble clicking the "Reset Password" button, copy and paste the URL below into your web
@endcomponent browser:
</p>
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])
If youre having trouble clicking the "Reset Password" button, copy and paste the URL below into your web browser:
<a href="{{ $link }}">{{ $link }}</a> <a href="{{ $link }}">{{ $link }}</a>
@endcomponent @endcomponent
@endcomponent

View File

@ -1,35 +1,12 @@
@component('mail::layout') @component('email.template.master', ['design' => 'light', 'whitelabel' => false])
{{-- Header --}} @slot('header')
@slot('header') @include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@component('mail::header', ['url' => config('app.url')]) @endslot
Header Title
<p>{{ ctrans('texts.confirmation_message') }}</p>
<a href="{{ url("/user/confirm/{$user->confirmation_code}") }}" target="_blank" class="button">
{{ ctrans('texts.confirm') }}
</a>
@endcomponent @endcomponent
@endslot
{{-- Body --}}
{{ $user }}
trans('texts.confirmation_message')
@component('mail::button', ['url' => url("/user/confirm/{$user->confirmation_code}")])
trans('texts.confirm')
@endcomponent
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('ninja.app_name') }}.
@endcomponent
@endslot
@endcomponent

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,82 +1,56 @@
@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header')
@include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@endslot
@slot('header') <h1>Import completed</h1>
@component('email.components.header') <p>Hello, here is the output of your recent import job.</p>
Import completed
@endcomponent
@endslot
@slot('greeting') @if(isset($clients) && count($clients) >=1)
Hello, <h3>Clients Imported: {{ count($clients) }} </h3>
@endslot @endif
Here is the output of your recent import job. <br><br> @if(isset($errors['clients']) && count($errors['clients']) >=1)
<h3>Client Errors</h3>
@if(isset($clients) && count($clients) >=1) <ul>
@foreach($errors['clients'] as $error)
<li>{{ $error['client'] }} - {{ $error['error'] }}</li>
@endforeach
</ul>
@endif
<h3>Clients Imported: {{ count($clients) }} </h3> @if(isset($invoices) && count($invoices) >=1)
@endif <h3>Invoices Imported: {{ count($invoices) }} </h3>
@if(isset($errors['clients']) && count($errors['clients']) >=1) @endif
<h3>Client Errors</h3> @if(isset($errors['invoices']) && count($errors['invoices']) >=1)
<h3>Invoices Errors</h3>
<ul> <ul>
@foreach($errors['clients'] as $error) @foreach($errors['invoices'] as $error)
<li>{{ $error['client'] }} - {{ $error['error'] }}</li> <li>{{ $error['invoice'] }} - {{ $error['error'] }}</li>
@endforeach @endforeach
</ul> </ul>
@endif @endif
@if(isset($invoices) && count($invoices) >=1) @if(isset($products) && count($products) >=1)
<h3>Products Imported: {{ count($products) }} </h3>
@endif
<h3>Invoices Imported: {{ count($invoices) }} </h3> @if(isset($errors['products']) && count($errors['products']) >=1)
<h3>Client Errors</h3>
@endif <ul>
@foreach($errors['products'] as $error)
<li>{{ $error['product'] }} - {{ $error['error'] }}</li>
@endforeach
</ul>
@endif
@if(isset($errors['invoices']) && count($errors['invoices']) >=1) <a href="{{ url('/') }}" target="_blank" class="button">Visit portal</a>
<h3>Invoices Errors</h3> <p>Thank you, <br/> Invoice Ninja.</p>
<ul>
@foreach($errors['invoices'] as $error)
<li>{{ $error['invoice'] }} - {{ $error['error'] }}</li>
@endforeach
</ul>
@endif
@if(isset($products) && count($products) >=1)
<h3>Products Imported: {{ count($products) }} </h3>
@endif
@if(isset($errors['products']) && count($errors['products']) >=1)
<h3>Client Errors</h3>
<ul>
@foreach($errors['products'] as $error)
<li>{{ $error['product'] }} - {{ $error['error'] }}</li>
@endforeach
</ul>
@endif
@component('email.components.button', ['url' => url('/')])
Visit portal
@endcomponent @endcomponent
@slot('signature')
Thank you, <br>
Invoice Ninja
@endslot
@slot('footer')
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])
For any info, please visit InvoiceNinja.
@endcomponent
@endslot
@endcomponent

View File

@ -1,26 +1,10 @@
@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header')
@include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@endslot
@slot('header') <h1>Payment for your invoice has been completed!</h1>
@component('email.components.header', ['p' => 'Payment for your invoice has been completed!', 'logo' => 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png']) <p>We want to inform you that payment was completed for your invoice.</p>
Invoice paid
@endcomponent
@endslot <a href="https://invoiceninja.com" target="_blank" class="button">Visit Invoice Ninja</a>
@slot('greeting')
Hello,
@endslot
We want to inform you that payment was completed for your invoice. Amount: $10,000.00.
@component('email.components.button', ['url' => 'https://invoiceninja.com', 'show_link' => true])
Visit InvoiceNinja
@endcomponent @endcomponent
@slot('below_card')
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])
For any info, please visit InvoiceNinja.
@endcomponent
@endslot
@endcomponent

View File

@ -1,31 +1,13 @@
@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header') @slot('header')
@component('email.components.header') @include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
Migration completed @endslot
@endcomponent
@endslot
@slot('greeting') <h1>Migration completed</h1>
Hello, <p>We're happy to inform you that migration has been completed successfully. It is ready for you to review it.</p>
@endslot
We're happy to inform you that migration has been completed successfully. It is ready for you to review it. <a href="{{ url('/') }}" target="_blank" class="button">Visit portal</a>
@component('email.components.button', ['url' => url('/')]) <p>Thank you, <br/> Invoice Ninja</p>
Visit portal
@endcomponent @endcomponent
@slot('signature')
Thank you, <br>
Invoice Ninja
@endslot
@slot('footer')
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])
For any info, please visit InvoiceNinja.
@endcomponent
@endslot
@endcomponent

View File

@ -1,4 +1,4 @@
@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header') @slot('header')
@component('email.components.header') @component('email.components.header')
@ -19,7 +19,7 @@ Looks like you already migrated your data to V2 version of the Invoice Ninja. In
@slot('signature') @slot('signature')
Thank you, <br> Thank you, <br>
Invoice Ninja Invoice Ninja
@endslot @endslot
@slot('footer') @slot('footer')
@ -28,4 +28,4 @@ Invoice Ninja
@endcomponent @endcomponent
@endslot @endslot
@endcomponent @endcomponent

View File

@ -1,7 +1,13 @@
Whoops! @component('email.template.master', ['design' => 'light', 'settings' => $settings])
Looks like your migration failed. @slot('header')
@include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@endslot
<pre> <h1>Whoops, migration failed.</h1>
{!! $exception->getMessage() !!} <p>Looks like your migration failed. Here's the error message:</p>
{!! $content !!}
</pre> <pre>
{!! $exception->getMessage() !!}
{!! $content !!}
</pre>
@endcomponent

View File

@ -1,26 +1,10 @@
@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header')
@include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@endslot
@slot('header') <h1>Quote approved!</h1>
@component('email.components.header', ['p' => 'Your quote was approved!', 'logo' => 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png']) <p>We want to inform you that quote was approved.</p>
Quote approved
@endcomponent
@endslot <a href="https://invoiceninja.com" target="_blank" class="button">Visit Invoice Ninja</a>
@slot('greeting')
Hello,
@endslot
We want to inform you that quote was approved. Put nicer text here.
@component('email.components.button', ['url' => 'https://invoiceninja.com', 'show_link' => true])
Visit InvoiceNinja
@endcomponent @endcomponent
@slot('below_card')
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])
For any info, please visit InvoiceNinja.
@endcomponent
@endslot
@endcomponent

View File

@ -1,30 +1,7 @@
@component('mail::layout') @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header')
{{-- Header --}} @include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@slot('header') @endslot
@component('mail::header', ['url' => config('app.url')])
Header Title
@endcomponent
@endslot
{{-- Body --}}
{{ $message }}
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('ninja.app_name') }}.
@endcomponent
@endslot
{{ $message }}
@endcomponent @endcomponent

View File

@ -1,40 +1,19 @@
@component('mail::layout') @component('email.template.master', ['design' => 'light', 'settings' => $settings])
@slot('header')
{{-- Header --}} @include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@slot('header') @endslot
@component('mail::header', ['url' => config('app.url')])
Header Title
@endcomponent
@endslot
{{-- Body --}}
{{ $message }}
{!! str_replace('\n', '<br>', $system_info) !!}
@if(@count($laravel_log) > 0)
<details>
<summary>{{ ctrans('texts.display_log') }}</summary>
@foreach($laravel_log as $log_line)
<small>{{ $log_line }}</small> <br>
@endforeach
</details>
@endif
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
@endcomponent
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} {{ config('ninja.app_name') }}.
@endcomponent
@endslot
{{-- Body --}}
{{ $message }}
{!! str_replace('\n', '<br>', $system_info) !!}
@if(@count($laravel_log) > 0)
<details>
<summary>{{ ctrans('texts.display_log') }}</summary>
@foreach($laravel_log as $log_line)
<small>{{ $log_line }}</small> <br>
@endforeach
</details>
@endif
@endcomponent @endcomponent

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))
{{$title}} {!! $body !!}
@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,78 +1,95 @@
@php @php
if(!isset($design)) $design = 'light'; if(!isset($design)) {
$design = 'light';
}
@endphp @endphp
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html lang="en"> "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"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>@yield('title')</title> </head>
</head>
<style> <style>
:root { :root {
@isset($settings) --primary-color: {{ isset($settings) ? $settings->primary_color : '#4caf50' }};
--primary-color: {{ $settings->primary_color }}; }
@else
--primary-color: #4caf50;
@endisset
}
.border-primary { .primary-color-bg {
border-color: var(--primary-color); background-color: var(--primary-color);
} }
#email-content h1, h2, h3, h4 {
display: block;
color: {{ $design == 'light' ? 'black' : 'white' }};
padding-bottom: 20px;
padding-top: 20px;
}
#email-content p {
display: block;
color: {{ $design == 'light' ? 'black' : 'white' }};
padding-bottom: 20px;
padding-top: 20px;
}
.button {
background-color: var(--primary-color);
color: white;
padding: 10px 16px;
text-decoration: none;
}
#email-content a, .link {
word-break: break-all;
}
</style> </style>
@if($design == 'dark') <body style="margin: 0; padding: 0; background-color: {{ $design == 'light' ? '#F9FAFB' : '#111827' }};">
<style> <table role="presentation" cellpadding="0" cellspacing="0" width="100%">
* { <tr>
color: #cbd5e0 !important; <td style="padding: 20px; font-family: Arial, sans-serif, 'Open Sans'">
} <table align="center" cellpadding="0" cellspacing="0" width="600"
</style> style="box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px 0 rgba(0,0,0,.06)">
@endif <tr>
<td align="center" bgcolor="#4caf50" class="primary-color-bg" style="padding: 40px 0 30px 0;">
<body class="{{ $design == 'light' ? 'bg-gray-200' : 'bg-gray-800' }} my-10 font-sans {{ $design == 'light' ? 'text-gray-700' : 'text-gray-400' }}"> {{ $header }}
<div class="grid grid-cols-6"> </td>
<div class="col-span-4 col-start-2"> </tr>
<div class="{{ $design == 'light' ? 'bg-white' : 'bg-gray-900' }} shadow border-t-2 {{ $design == 'light' ? 'border-primary' : 'border-gray-800' }}"> <tr>
<div class="px-10 break-all"> <td bgcolor="{{ $design == 'light' ? '#ffffff' : '#1F2937'}}" style="padding: 40px 30px 40px 30px;">
{{ $header }} <table cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
</div> <tr>
<div id="text" class="flex flex-col px-10 py-6"> <td align="center" id="email-content">
@isset($greeting) {{ $slot }}
{{ $greeting }} </td>
@endisset </tr>
</table>
<div class="break-all"> </td>
{{ $slot}} </tr>
</div> <tr>
@isset($whitelabel)
@isset($signature) @if(!$whitelabel)
{{ $signature }} <td bgcolor="{{ $design == 'light' ? '#ffffff' : '#1F2937'}}" style="padding-top: 20px; padding-bottom: 20px;" align="center">
@endisset <p style="margin: 0; border-top: 1px solid {{ $design == 'light' ? '#F3F4F6' : '#374151' }}; padding-top: 20px;">
</div> <a href="https://invoiceninja.com" target="_blank">
</div> <img
style="height: 4rem; {{ $design == 'dark' ? 'filter: invert(100%);' : '' }}"
@isset($below_card) src="{{ asset('images/created-by-invoiceninja-new.png') }}"
<div id="bottomText" class="px-10 my-4 text-center"> alt="Invoice Ninja">
{{ $below_card }} </a>
</div> </p>
@endisset </td>
@endif
</div> @endif
</div> </tr>
</table>
<!-- Whitelabel --> </td>
@isset($whitelabel) </tr>
@if(!$whitelabel) </table>
<div style="display: flex; flex-direction: row; justify-content: center; margin-top: 1rem; margin-bottom: 1rem;">
<a href="https://invoiceninja.com" target="_blank">
<img style="height: 4rem; {{ $design == 'dark' ? 'filter: invert(100%);' : '' }}" src="{{ asset('images/created-by-invoiceninja-new.png') }}" alt="Invoice Ninja">
</a>
</div>
@endif
@endif
</body> </body>
</html>
</html>

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"> </html>
{!! $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>