From 938096d50bf8118516647f33a5930f9d18d8cce4 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 22 Oct 2017 12:37:24 +0300 Subject: [PATCH] Added Invoice Ninja footer to emails --- app/Models/Account.php | 5 +++++ resources/lang/en/texts.php | 2 +- resources/views/emails/design2_html.blade.php | 12 ++++++++---- resources/views/emails/design3_html.blade.php | 12 ++++++++---- resources/views/emails/invoice_html.blade.php | 6 +++++- resources/views/emails/invoice_text.blade.php | 6 +++++- resources/views/emails/master.blade.php | 16 ++++++++-------- resources/views/emails/master_contact.blade.php | 14 -------------- .../emails/payment_confirmation_html.blade.php | 4 ++++ .../emails/payment_confirmation_text.blade.php | 6 +++++- 10 files changed, 49 insertions(+), 34 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index e59def937753..61643b68df36 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1085,6 +1085,11 @@ class Account extends Eloquent } } + public function isPaid() + { + return Utils::isNinja() ? $this->isPro() : Utils::isWhiteLabel(); + } + /** * @param null $plan_details * diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index e16cea901f57..3b3acb910b2b 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -305,7 +305,7 @@ $LANG = array( 'specify_colors' => 'Specify colors', 'specify_colors_label' => 'Select the colors used in the invoice', 'chart_builder' => 'Chart Builder', - 'ninja_email_footer' => 'Use :site to invoice your clients and get paid online for free!', + 'ninja_email_footer' => 'Created by :site. Create. Send. Get Paid.', 'go_pro' => 'Go Pro', 'quote' => 'Quote', 'quotes' => 'Quotes', diff --git a/resources/views/emails/design2_html.blade.php b/resources/views/emails/design2_html.blade.php index 6ff1b8db388e..f4a6e3b48414 100644 --- a/resources/views/emails/design2_html.blade.php +++ b/resources/views/emails/design2_html.blade.php @@ -63,10 +63,14 @@ @section('footer')

- {{ $account->present()->address }} -
- @if ($account->website) - {{ $account->website }} + @if (! $account->isPaid()) + {!! trans('texts.ninja_email_footer', ['site' => link_to(NINJA_WEB_URL . '?utm_source=email_footer', APP_NAME)]) !!} + @else + {{ $account->present()->address }} +
+ @if ($account->website) + {{ $account->website }} + @endif @endif

@stop diff --git a/resources/views/emails/design3_html.blade.php b/resources/views/emails/design3_html.blade.php index 8d3410e0c9f6..a2f76e709895 100644 --- a/resources/views/emails/design3_html.blade.php +++ b/resources/views/emails/design3_html.blade.php @@ -63,10 +63,14 @@ @section('footer')

- {{ $account->present()->address }} -
- @if ($account->website) - {{ $account->website }} + @if (! $account->isPaid()) + {!! trans('texts.ninja_email_footer', ['site' => link_to(NINJA_WEB_URL . '?utm_source=email_footer', APP_NAME)]) !!} + @else + {{ $account->present()->address }} +
+ @if ($account->website) + {{ $account->website }} + @endif @endif

@stop diff --git a/resources/views/emails/invoice_html.blade.php b/resources/views/emails/invoice_html.blade.php index 5e79429077a5..05f307e1d122 100644 --- a/resources/views/emails/invoice_html.blade.php +++ b/resources/views/emails/invoice_html.blade.php @@ -8,5 +8,9 @@ @include('emails.partials.client_view_action') @endif {!! $body !!} + @if (! $account->isPaid()) +
+ {!! trans('texts.ninja_email_footer', ['site' => link_to(NINJA_WEB_URL . '?utm_source=email_footer', APP_NAME)]) !!} + @endif - \ No newline at end of file + diff --git a/resources/views/emails/invoice_text.blade.php b/resources/views/emails/invoice_text.blade.php index 2b79b9861f70..3d64fb667cf4 100644 --- a/resources/views/emails/invoice_text.blade.php +++ b/resources/views/emails/invoice_text.blade.php @@ -1 +1,5 @@ -{!! strip_tags(str_replace('', "\n\n", $body)) !!} \ No newline at end of file +{!! strip_tags(str_replace('', "\n\n", $body)) !!} + +@if (! $account->isPaid()) + {{ trans('texts.ninja_email_footer', ['site' => NINJA_WEB_URL . '?utm_source=email_footer']) }} +@endif diff --git a/resources/views/emails/master.blade.php b/resources/views/emails/master.blade.php index c96bae0d78d4..a8b344411211 100644 --- a/resources/views/emails/master.blade.php +++ b/resources/views/emails/master.blade.php @@ -8,7 +8,7 @@ @endif - @yield('markup') @@ -50,25 +50,25 @@ font-size: 12px; } } - + -
+
@yield('content') - + -
-
+
- \ No newline at end of file + diff --git a/resources/views/emails/master_contact.blade.php b/resources/views/emails/master_contact.blade.php index 56124953bff3..4a52e15e4fdd 100644 --- a/resources/views/emails/master_contact.blade.php +++ b/resources/views/emails/master_contact.blade.php @@ -25,17 +25,3 @@ @stop - -@section('footer') - @if (Utils::isNinja() || ! Utils::isWhiteLabel()) -

- Facebook - Twitter - GitHub -

- -

- © {{ date('Y') }} Invoice Ninja
-

- @endif -@stop diff --git a/resources/views/emails/payment_confirmation_html.blade.php b/resources/views/emails/payment_confirmation_html.blade.php index 90370a737a1f..b4b535eea74b 100644 --- a/resources/views/emails/payment_confirmation_html.blade.php +++ b/resources/views/emails/payment_confirmation_html.blade.php @@ -8,5 +8,9 @@ @include('emails.partials.client_view_action', ['link' => $link]) @endif {!! $body !!} + @if (! $account->isPaid()) +
+ {!! trans('texts.ninja_email_footer', ['site' => link_to(NINJA_WEB_URL . '?utm_source=email_footer', APP_NAME)]) !!} + @endif diff --git a/resources/views/emails/payment_confirmation_text.blade.php b/resources/views/emails/payment_confirmation_text.blade.php index 2b79b9861f70..3d64fb667cf4 100644 --- a/resources/views/emails/payment_confirmation_text.blade.php +++ b/resources/views/emails/payment_confirmation_text.blade.php @@ -1 +1,5 @@ -{!! strip_tags(str_replace('', "\n\n", $body)) !!} \ No newline at end of file +{!! strip_tags(str_replace('', "\n\n", $body)) !!} + +@if (! $account->isPaid()) + {{ trans('texts.ninja_email_footer', ['site' => NINJA_WEB_URL . '?utm_source=email_footer']) }} +@endif