Move email/ resources to mail/, added invoice generated email to admin, updated email template

This commit is contained in:
2024-08-03 10:06:25 +10:00
parent f8453ae391
commit 0469d64577
40 changed files with 439 additions and 213 deletions

View File

@@ -1,27 +0,0 @@
@component('mail::message',['site'=>$site,'heading'=>'Invoice: '.$invoice->id])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
A new invoice has been generated on your account. A summary of that invoice is below.
@component('mail::table')
| # | ID | Name | Amount |
| -: | - |:-----| ------:|
@foreach ($invoice->summary_products() as $item)
| {{ $item['services']->count() }} | {{ $item['product']->lid }} | {{ $item['product']->name }} | ${{ number_format($item['total'],2) }} |
@endforeach
||| Sub Total | ${{ number_format($invoice->sub_total,2) }} |
||| Tax | ${{ number_format($invoice->tax_total,2) }} |
||| Total | ${{ number_format($invoice->total,2) }} |
||| Payments | ${{ number_format($invoice->paid,2) }} |
||| Still Due | ${{ number_format($invoice->due,2) }} |
@endcomponent
If you would like a PDF copy of that invoice, please click on the link below:
@component('mail::panel',['url'=>$invoice->download_link()])
Download PDF
@endcomponent
Thanks,<br>
{{ config('mail.from.name') }}
@endcomponent

View File

@@ -0,0 +1,25 @@
@component('mail::message',['site'=>$site,'heading'=>'Invoice: #'.$io->id,'subheading'=>sprintf('Due: <strong>%s</strong>',$io->due_at->format('Y-m-d'))])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
A new invoice has been generated for <strong>{{ $io->account->name }}</strong>. A summary of that invoice is below:
@component('mail::table')
| ID | # | Name | Amount |
| -: | -: |:-----| ------:|
@foreach ($io->summary_products() as $item)
| {{ $item['product']->lid }} | {{ $item['services']->count() }} | {{ $item['product']->name }} | ${{ number_format($item['total'],2) }} |
@endforeach
||| Sub Total | ${{ number_format($io->sub_total,2) }} |
||| Tax | ${{ number_format($io->tax_total,2) }} |
||| **Total** | **${{ number_format($io->total,2) }}** |
@endcomponent
This invoice will be automatically emailed in {{ config('osb.invoice_review') }} days time.
@component('mail::button',['url'=>url('u/invoice',$io->id)])
Review
@endcomponent
Thanks,<br>
{{ config('mail.from.name') }}
@endcomponent

View File

@@ -1,8 +1,6 @@
@component('mail::message',['site'=>$site])
# Your order was rejected.
@component('mail::panel')
@component('mail::table')
| Service | Details |
| :---------- | :---------------- |
@@ -22,8 +20,6 @@
**REASON:** {{ $reason }}
@endcomponent
Thanks,<br>
{{ config('app.name') }}
@endcomponent

View File

@@ -0,0 +1,29 @@
@component('mail::message',['site'=>$site,'heading'=>'Invoice: #'.$io->lid,'subheading'=>sprintf('Due: <strong>%s</strong>',$io->due_at->format('Y-m-d'))])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
A new invoice has been generated on your account. A summary of that invoice is below:
@component('mail::table')
| ID | # | Name | Amount |
| -: | -: |:-----| ------:|
@foreach ($io->summary_products() as $item)
| {{ $item['product']->lid }} | {{ $item['services']->count() }} | {{ $item['product']->name }} | ${{ number_format($item['total'],2) }} |
@endforeach
||| Sub Total | ${{ number_format($io->sub_total,2) }} |
||| Tax | ${{ number_format($io->tax_total,2) }} |
||| **Total** | **${{ number_format($io->total,2) }}** |
@if($io->paid)
||| Payments | ${{ number_format($io->paid,2) }} |
||| Still Due | ${{ number_format($io->due,2) }} |
@endif
@endcomponent
If you would like a PDF copy of that invoice, please click on the link below:
@component('mail::button',['url'=>$io->download_link()])
Download
@endcomponent
Thanks,<br>
{{ config('mail.from.name') }}
@endcomponent

View File

@@ -5,8 +5,8 @@ A request was made to link your account to a social login.
If you didnt make this request, you can ignore this, and the request will be ignored.
If you did make the request, then please enter the code displayed below.
@component('mail::panel')
{{ $token }}
@component('mail::button')
{{ $token }}
@endcomponent
Once you've keyed in this code, you'll be able to login to your account using your social login instead of a username and a password.
@@ -15,7 +15,7 @@ Thanks,
{{ config('mail.from.name') }}
@component('mail::subcopy')
@component('mail::subcontent')
If you didnt make this request, you can safely ignore this email - no change was made to your account, nor was it accessed by an unauthorised person.
@endcomponent
@endcomponent

View File

@@ -6,12 +6,12 @@ You are receiving this email because we received a password reset request for yo
If you did not request a password reset, no further action is required.
To reset your password, please follow this link, or click on the URL below:
@component('mail::panel',['url'=>$reset_link])
Reset Password
@component('mail::button',['url'=>$reset_link])
Reset Password
@endcomponent
@component('mail::subcopy')
Reset password: {{ $reset_link }}
@component('mail::subcontent')
Reset password: {{ $reset_link }}
@endcomponent
Thanks,<br>

View File

@@ -128,6 +128,19 @@
@endforeach
@endforeach
@endforeach
@if($o->summary_other()->count())
<tr>
<td colspan="7">{{ $item['description'] }}</td>
</tr>
@foreach($o->summary_other() as $item)
<tr>
<td colspan="2">&nbsp;</td>
<td>{{ $item['description'] }}</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>

View File

@@ -0,0 +1,9 @@
<div style="margin: auto; text-align: center; padding-top: 20px;padding-bottom: 20px;">
<div class="button">
@isset($url)
<a href="{{ $url }}">{{ $slot }}</a>
@else
{{ $slot }}
@endisset
</div>
</div>

View File

@@ -1,3 +1 @@
<div class="footer">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</div>
{{ Illuminate\Mail\Markdown::parse($slot) }}

View File

@@ -1,6 +1,5 @@
<div class="header">
<div class="fixedw">
<img src="{{ url($site->email_logo) }}"><br>
<div class="subject">{{ $slot }}</div>
</div>
</div>
<img class="right" src="{{ url($site->email_logo) }}"><br>
<div class="heading">{{ $slot }}</div>
@if($subheading)
<div class="subheading">{!! $subheading !!}</div>
@endif

View File

@@ -1,25 +1,32 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="color-scheme" content="light only">
<meta name="supported-color-schemes" content="light only">
<link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'>
<link href="http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900,400italic,300italic" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="color-scheme" content="light only">
<meta name="supported-color-schemes" content="light only">
{{--
<link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'>
--}}
<link href="http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900,400italic,300italic" rel="stylesheet" type="text/css">
</head>
<body>
{{ $header ?? '' }}
<section class="header">
<div class="fixedw main-header">
{{ $header ?? '' }}
</div>
</section>
<section class="content">
<div class="fixedw main-body">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</div>
<section class="content">
<div class="fixedw main-body">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</div>
{{ $subcopy ?? '' }}
</section>
{{ $footer ?? '' }}
{{ $subcontent ?? '' }}
</section>
<section class="footer">
<div class="fixedw main-footer">
{{ $footer ?? '' }}
</div>
</section>
</body>
</html>

View File

@@ -1,7 +1,7 @@
@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header',['site'=>$site])
@component('mail::header',['site'=>$site,'subheading'=>$subheading ?? NULL])
{{ $heading }}
@endcomponent
@endslot
@@ -9,11 +9,11 @@
{{-- Body --}}
{{ $slot }}
{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
{{ $subcopy }}
{{-- Sub Content --}}
@isset($subcontent)
@slot('subcontent')
@component('mail::subcontent')
{{ $subcontent }}
@endcomponent
@endslot
@endisset
@@ -21,11 +21,9 @@
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
<div class="fixedw" style="text-align: right; font-size: 0.8em;">
{{ config('mail.from.name') }}<br>
{!! $site->address->join('<br>') !!}<br>
{{ $site->site_email }}
</div>
@endcomponent
@endslot
@endcomponent
@endcomponent

View File

@@ -1,9 +0,0 @@
<div style="margin: auto; text-align: center; padding-bottom: 20px;">
<div class="panel">
@isset($url)
<a href="{{ $url }}">{{ $slot }}</a>
@else
{{ $slot }}
@endisset
</div>
</div>

View File

@@ -1,3 +1 @@
<div class="light-box">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</div>
{{ Illuminate\Mail\Markdown::parse($slot) }}

View File

@@ -1,88 +1,104 @@
body{
margin: 0 auto;
font-family: 'Bree Serif';
background: #f4f4f4;
color: #6c7584;
font-size: 1.2em;
margin:0 auto;
font-family:'Roboto', serif;
color:#121212;
font-size:1.0em;
padding-top:20px;
}
.header{
background: #232323;
border-bottom: 5px solid #454d59;
padding: 20px 0px 10px 0px;
margin-bottom: 30px;
color: #f4f4f4;
font-weight: 300;
margin-bottom:0;
}
.footer{
background: #232323;
border-top: 5px solid #454d59;
padding: 10px 0px 20px 0px;
margin-top: 30px;
color: #f4f4f4;
font-weight: 100;
}
.subject{
font-weight: 300;
font-family: 'Bree Serif',serif;
font-size: 1.5em;
/* text-align: right; */
.main-header{
background:#fafafa;
border-top-left-radius:10px;
border-top-right-radius:10px;
color:#121212;
font-weight:400;
padding:10px 20px;
border-top:1px solid #dbdbdb;
border-right:1px solid #dbdbdb;
border-left:1px solid #dbdbdb;
}
.panel{
background:#454d59;
border-radius: 10px;
margin-top: 20px;
padding: 20px;
font-weight: 300;
color: #f4f4f4;
font-size: 1.4em;
display: inline-block
.main-header img{
width:250px;
}
.light-box{
background: #f9f9f9;
border-radius: 10px;
padding: 10px;
font-weight: 300;
margin-top: 10px;
font-size: 0.8em;
margin-bottom: 10px;
.main-header .heading{
font-weight:bold;
font-size:1.4em;
padding:5px 0;
}
.main-header .subheading{
font-size:0.8em;
padding:5px 0;
}
.main-body{
background: #ffffff;
border-radius: 10px;
color:#6c7584;
font-weight: 400;
background:#ffffff;
padding:10px 20px;
border-top:1px solid #dbdbdb;
border-left:1px solid #dbdbdb;
border-right:1px solid #dbdbdb;
border-bottom:3px solid #dbdbdb;
border-bottom:1px solid #dbdbdb;
}
.main-body table{
width: 100%;
background:#fdfdfd;
border-radius:10px;
padding:10px;
font-weight:300;
margin-top:10px;
font-size:0.8em;
margin-bottom:10px;
border: 1px dashed #dbdbdb
}
.main-body table thead td{
font-weight: 300;
border-bottom: 1px solid #dbdbdb;
color: #ccc
font-weight:300;
border-bottom:1px solid #dbdbdb;
}
.main-body table td.title{
font-size: 1.1em;
line-height: 20px;
font-size:1.1em;
line-height:20px;
color:#6c7584
}
.main-body table td.title small{
font-weight: 300;
font-size: 0.9em;
color: #6c7584
font-weight:300;
font-size:0.9em;
color:#6c7584
}
.main-body .note{
font-size:0.8em;
font-weight:300;
font-style:normal;
}
.main-footer{
background:#2f2f2f;
border-bottom-left-radius:10px;
border-bottom-right-radius:10px;
color:#fefefe;
padding:10px 20px;
margin: 0 0 0 auto;
border-bottom:1px solid #dbdbdb;
border-right:1px solid #dbdbdb;
border-left:1px solid #dbdbdb;
font-size: 0.8em;
font-weight: 300;
font-style: normal;
text-align: right;
}
.panel a{
text-decoration: underline;
color: #f4f4f4;
.button{
background:#2f2f2f;
border-radius:5px;
padding:10px;
color:#fafafa;
font-size:1em;
display:inline-block
}
.panel a:hover{
text-decoration: none;
color: #ffffff;
.button a{
text-decoration:none;
color:#fafafa;
}
.button a:hover{
text-decoration:none;
color:#ffffff;
}
/* -- TO VALIDATE -- */
@@ -114,15 +130,17 @@ h3{
color: #333;
font-size:18px;
}
.links table td span, .links table td a{font-weight: 400}
.border-l{border-left:1px solid #ccc}
.links table td span, .links table td a{
font-weight: 400
}
.apikey{font-size: 18px; color:#333}
.apikey p{border-bottom: 1px solid #dbdbdb; padding: 10px 0 10px 0;margin: 0 0;}
.apikey p.last{border-bottom: none}
.apikey small{font-size: 80%; font-weight: 300}
.twitter{padding: 20px; font-weight: 300;font-size:16px;}
.fixedw{width: 80%; margin: 0 auto;}
.right{float:right}
.left{float:left}
.clear{clear: both;}
table thead td {font-size: 16px;}
pre {white-space:pre-wrap;}

View File

@@ -0,0 +1 @@
{{ $slot }}