split out email files

This commit is contained in:
Nabeel Shahzad 2018-05-21 11:25:51 -05:00
parent 9173558a0b
commit 072a7ffe12
8 changed files with 161 additions and 153 deletions

View File

@ -46,4 +46,8 @@ return [
'submit' => 'Submit', 'submit' => 'Submit',
'edit' => 'Edit', 'edit' => 'Edit',
'close' => 'Close', 'close' => 'Close',
'whoops' => 'Whoops',
'hello' => 'Hello',
'regards' => 'Regards',
'rightsreserved' => 'All Rights Reserved',
]; ];

View File

@ -0,0 +1,10 @@
<?php
/**
*
*/
return [
'buttontroubles' =>
'If youre having trouble clicking the ":actiontext" button, ' .
'copy and paste the URL below into your web browser:',
];

View File

@ -6,14 +6,4 @@ return [
'nodownloads' => 'There are no downloads!', 'nodownloads' => 'There are no downloads!',
], ],
'emails' => [
'whoops' => 'Whoops',
'hello' => 'Hello',
'regards' => 'Regards',
'buttontroubles' => [
'If youre having trouble clicking the ":actiontext" button,',
'copy and paste the URL below into your web browser:',
],
'allrightsreserved' => 'All Rights Reserved',
],
]; ];

View File

@ -47,4 +47,8 @@ return [
'submit' => 'Invia', 'submit' => 'Invia',
'edit' => 'Modifica', 'edit' => 'Modifica',
'close' => 'Chiudi', 'close' => 'Chiudi',
'whoops' => 'Ops',
'hello' => 'Ciao',
'regards' => 'Saluti',
'rightsreserved' => 'Tutti i Diritti Riservati',
]; ];

View File

@ -0,0 +1,10 @@
<?php
/**
*
*/
return [
'buttontroubles' =>
'Se hai problemi a cliccare il bottone ":actiontext", ' .
'copia e incolla l\'URL qui sotto nel tuo browser:',
];

View File

@ -1,21 +1,7 @@
<?php <?php
return [ return [
'emails' => [
'whoops' => 'Ops',
'hello' => 'Ciao',
'regards' => 'Saluti',
'buttontroubles' => [
'Se hai problemi a cliccare il bottone ":actiontext",',
'copia e incolla l\'URL qui sotto nel tuo browser:',
],
'allrightsreserved' => 'Tutti i Diritti Riservati',
],
'downloads' => [ 'downloads' => [
'nodownloads' => 'Non ci sono downloads!', 'nodownloads' => 'Non ci sono downloads!',
], ],
]; ];

View File

@ -3,7 +3,7 @@
if (! empty($greeting)) { if (! empty($greeting)) {
echo $greeting, "\n\n"; echo $greeting, "\n\n";
} else { } else {
echo $level == 'error' ? trans('frontend.emails.whoops').'!' : trans('frontend.emails.hello').',', "\n\n"; echo $level == 'error' ? __('common.whoops').'!' : __('common.hello').',', "\n\n";
} }
if (! empty($introLines)) { if (! empty($introLines)) {
@ -18,5 +18,5 @@ if (! empty($outroLines)) {
echo implode("\n", $outroLines), "\n\n"; echo implode("\n", $outroLines), "\n\n";
} }
echo trans('frontend.emails.regards).',', "\n"; echo __('common.regards).',', "\n";
echo config('app.name'), "\n"; echo config('app.name'), "\n";

View File

@ -2,8 +2,8 @@
<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" rel="stylesheet" media="all"> <style type="text/css" rel="stylesheet" media="all">
/* Media Queries */ /* Media Queries */
@ -20,32 +20,32 @@
$style = [ $style = [
/* Layout ------------------------------ */ /* Layout ------------------------------ */
'body' => 'margin: 0; padding: 0; width: 100%; background-color: #F2F4F6;', 'body' => 'margin: 0; padding: 0; width: 100%; background-color: #F2F4F6;',
'email-wrapper' => 'width: 100%; margin: 0; padding: 0; background-color: #F2F4F6;', 'email-wrapper' => 'width: 100%; margin: 0; padding: 0; background-color: #F2F4F6;',
/* Masthead ----------------------- */ /* Masthead ----------------------- */
'email-masthead' => 'padding: 25px 0; text-align: center;', 'email-masthead' => 'padding: 25px 0; text-align: center;',
'email-masthead_name' => 'font-size: 16px; font-weight: bold; color: #2F3133; text-decoration: none; text-shadow: 0 1px 0 white;', 'email-masthead_name' => 'font-size: 16px; font-weight: bold; color: #2F3133; text-decoration: none; text-shadow: 0 1px 0 white;',
'email-body' => 'width: 100%; margin: 0; padding: 0; border-top: 1px solid #EDEFF2; border-bottom: 1px solid #EDEFF2; background-color: #FFF;', 'email-body' => 'width: 100%; margin: 0; padding: 0; border-top: 1px solid #EDEFF2; border-bottom: 1px solid #EDEFF2; background-color: #FFF;',
'email-body_inner' => 'width: auto; max-width: 570px; margin: 0 auto; padding: 0;', 'email-body_inner' => 'width: auto; max-width: 570px; margin: 0 auto; padding: 0;',
'email-body_cell' => 'padding: 35px;', 'email-body_cell' => 'padding: 35px;',
'email-footer' => 'width: auto; max-width: 570px; margin: 0 auto; padding: 0; text-align: center;', 'email-footer' => 'width: auto; max-width: 570px; margin: 0 auto; padding: 0; text-align: center;',
'email-footer_cell' => 'color: #AEAEAE; padding: 35px; text-align: center;', 'email-footer_cell' => 'color: #AEAEAE; padding: 35px; text-align: center;',
/* Body ------------------------------ */ /* Body ------------------------------ */
'body_action' => 'width: 100%; margin: 30px auto; padding: 0; text-align: center;', 'body_action' => 'width: 100%; margin: 30px auto; padding: 0; text-align: center;',
'body_sub' => 'margin-top: 25px; padding-top: 25px; border-top: 1px solid #EDEFF2;', 'body_sub' => 'margin-top: 25px; padding-top: 25px; border-top: 1px solid #EDEFF2;',
/* Type ------------------------------ */ /* Type ------------------------------ */
'anchor' => 'color: #3869D4;', 'anchor' => 'color: #3869D4;',
'header-1' => 'margin-top: 0; color: #2F3133; font-size: 19px; font-weight: bold; text-align: left;', 'header-1' => 'margin-top: 0; color: #2F3133; font-size: 19px; font-weight: bold; text-align: left;',
'paragraph' => 'margin-top: 0; color: #74787E; font-size: 16px; line-height: 1.5em;', 'paragraph' => 'margin-top: 0; color: #74787E; font-size: 16px; line-height: 1.5em;',
'paragraph-sub' => 'margin-top: 0; color: #74787E; font-size: 12px; line-height: 1.5em;', 'paragraph-sub' => 'margin-top: 0; color: #74787E; font-size: 12px; line-height: 1.5em;',
'paragraph-center' => 'text-align: center;', 'paragraph-center' => 'text-align: center;',
/* Buttons ------------------------------ */ /* Buttons ------------------------------ */
@ -55,135 +55,139 @@ $style = [
text-align: center; text-decoration: none; -webkit-text-size-adjust: none;', text-align: center; text-decoration: none; -webkit-text-size-adjust: none;',
'button--green' => 'background-color: #22BC66;', 'button--green' => 'background-color: #22BC66;',
'button--red' => 'background-color: #dc4d2f;', 'button--red' => 'background-color: #dc4d2f;',
'button--blue' => 'background-color: #3869D4;', 'button--blue' => 'background-color: #3869D4;',
]; ];
?> ?>
<?php $fontFamily = 'font-family: Arial, \'Helvetica Neue\', Helvetica, sans-serif;'; ?> <?php $fontFamily = 'font-family: Arial, \'Helvetica Neue\', Helvetica, sans-serif;'; ?>
<body style="{{ $style['body'] }}"> <body style="{{ $style['body'] }}">
<table width="100%" cellpadding="0" cellspacing="0"> <table width="100%" cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="{{ $style['email-wrapper'] }}" align="center"> <td style="{{ $style['email-wrapper'] }}" align="center">
<table width="100%" cellpadding="0" cellspacing="0"> <table width="100%" cellpadding="0" cellspacing="0">
<!-- Logo --> <!-- Logo -->
<tr> <tr>
<td style="{{ $style['email-masthead'] }}"> <td style="{{ $style['email-masthead'] }}">
<a style="{{ $fontFamily }} {{ $style['email-masthead_name'] }}" href="{{ url('/') }}" target="_blank"> <a style="{{ $fontFamily }} {{ $style['email-masthead_name'] }}"
{{ config('app.name') }} href="{{ url('/') }}" target="_blank">
</a> {{ config('app.name') }}
</td> </a>
</tr> </td>
</tr>
<!-- Email Body --> <!-- Email Body -->
<tr> <tr>
<td style="{{ $style['email-body'] }}" width="100%"> <td style="{{ $style['email-body'] }}" width="100%">
<table style="{{ $style['email-body_inner'] }}" align="center" width="570" cellpadding="0" cellspacing="0"> <table style="{{ $style['email-body_inner'] }}" align="center" width="570"
<tr> cellpadding="0" cellspacing="0">
<td style="{{ $fontFamily }} {{ $style['email-body_cell'] }}"> <tr>
<!-- Greeting --> <td style="{{ $fontFamily }} {{ $style['email-body_cell'] }}">
<h1 style="{{ $style['header-1'] }}"> <!-- Greeting -->
@if ($level == 'error') <h1 style="{{ $style['header-1'] }}">
@lang('frontend.emails.whoops')! @if ($level === 'error')
@else @lang('common.whoops')!
@lang('frontend.emails.hello'), @else
@endif @lang('common.hello'),
</h1>
<!-- Intro -->
@foreach ($introLines as $line)
<p style="{{ $style['paragraph'] }}">
{{ $line }}
</p>
@endforeach
<!-- Action Button -->
@if (isset($actionText))
<table style="{{ $style['body_action'] }}" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<?php
switch ($level) {
case 'success':
$actionColor = 'button--green';
break;
case 'error':
$actionColor = 'button--red';
break;
default:
$actionColor = 'button--blue';
}
?>
<a href="{{ $actionUrl }}"
style="{{ $fontFamily }} {{ $style['button'] }} {{ $style[$actionColor] }}"
class="button"
target="_blank">
{{ $actionText }}
</a>
</td>
</tr>
</table>
@endif @endif
</h1>
<!-- Outro --> <!-- Intro -->
@foreach ($outroLines as $line) @foreach ($introLines as $line)
<p style="{{ $style['paragraph'] }}">
{{ $line }}
</p>
@endforeach
<!-- Salutation -->
<p style="{{ $style['paragraph'] }}"> <p style="{{ $style['paragraph'] }}">
@lang('frontend.emails.regards'),<br>{{ config('app.name') }} {{ $line }}
</p> </p>
@endforeach
<!-- Sub Copy --> <!-- Action Button -->
@if (isset($actionText)) @if (isset($actionText))
<table style="{{ $style['body_sub'] }}"> <table style="{{ $style['body_action'] }}" align="center"
<tr> width="100%" cellpadding="0" cellspacing="0">
<td style="{{ $fontFamily }}"> <tr>
<p style="{{ $style['paragraph-sub'] }}"> <td align="center">
@foreach(trans('frontend.emails.buttontroubles' as $line) <?php
{{ str_replace(':actiontext', $actionText, $line) }} switch ($level) {
@endforeach case 'success':
</p> $actionColor = 'button--green';
break;
case 'error':
$actionColor = 'button--red';
break;
default:
$actionColor = 'button--blue';
}
?>
<p style="{{ $style['paragraph-sub'] }}"> <a href="{{ $actionUrl }}"
<a style="{{ $style['anchor'] }}" href="{{ $actionUrl }}" target="_blank"> style="{{ $fontFamily }} {{ $style['button'] }} {{ $style[$actionColor] }}"
{{ $actionUrl }} class="button"
</a> target="_blank">
</p> {{ $actionText }}
</td> </a>
</tr> </td>
</table> </tr>
@endif </table>
</td> @endif
</tr>
</table>
</td>
</tr>
<!-- Footer --> <!-- Outro -->
<tr> @foreach ($outroLines as $line)
<td> <p style="{{ $style['paragraph'] }}">
<table style="{{ $style['email-footer'] }}" align="center" width="570" cellpadding="0" cellspacing="0"> {{ $line }}
<tr>
<td style="{{ $fontFamily }} {{ $style['email-footer_cell'] }}">
<p style="{{ $style['paragraph-sub'] }}">
&copy; {{ date('Y') }}
<a style="{{ $style['anchor'] }}" href="{{ url('/') }}" target="_blank">{{ config('app.name') }}</a>.
@lang(frontend.emails.allrightsreserved')
</p> </p>
</td> @endforeach
</tr>
</table> <!-- Salutation -->
</td> <p style="{{ $style['paragraph'] }}">
</tr> @lang('common.regards')
</table> ,<br>{{ config('app.name') }}
</td> </p>
</tr>
</table> <!-- Sub Copy -->
@if (isset($actionText))
<table style="{{ $style['body_sub'] }}">
<tr>
<td style="{{ $fontFamily }}">
<p style="{{ $style['paragraph-sub'] }}">
@lang('email.buttontroubles')
</p>
<p style="{{ $style['paragraph-sub'] }}">
<a style="{{ $style['anchor'] }}"
href="{{ $actionUrl }}" target="_blank">
{{ $actionUrl }}
</a>
</p>
</td>
</tr>
</table>
@endif
</td>
</tr>
</table>
</td>
</tr>
<!-- Footer -->
<tr>
<td>
<table style="{{ $style['email-footer'] }}" align="center" width="570"
cellpadding="0" cellspacing="0">
<tr>
<td style="{{ $fontFamily }} {{ $style['email-footer_cell'] }}">
<p style="{{ $style['paragraph-sub'] }}">
&copy; {{ date('Y') }}
<a style="{{ $style['anchor'] }}" href="{{ url('/') }}"
target="_blank">{{ config('app.name') }}</a>.
@lang('common.rightsreserved')
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body> </body>
</html> </html>