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

@@ -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

@@ -0,0 +1,26 @@
@component('mail::message',['site'=>$site,'heading'=>'New Order'])
Please order the following...
@component('mail::table')
| Service | Details |
| :---------- | :---------------- |
| Logged User | {{ Auth::user() ? Auth::user()->id : '-' }} |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product->name }} |
@switch($service->product->category)
@case('broadband')
| Address | {{ $service->type->service_address }} |
@break;
@case('phone')
| Number | {{ $service->type->service_number }} |
| Supplier Details | {{ $service->order_info->join(':') }} |
@break;
@endswitch
@endcomponent
**NOTES:** {{ $notes }}
Thanks,<br>
{{ config('app.name') }}
@endcomponent

View File

@@ -0,0 +1,25 @@
@component('mail::message',['site'=>$site])
# Your order was rejected.
@component('mail::table')
| Service | Details |
| :---------- | :---------------- |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product->name }} |
@switch($service->product->category)
@case('broadband')
| Address | {{ is_object($service->type) ? $service->type->service_address : 'Not Supplied' }} |
@break;
@case('phone')
| Address | {{ is_object($service->type) ? $service->type->service_address : 'Not Supplied' }} |
| Supplier Details | {{ join(':',$service->order_info) }} |
@break;
@endswitch
@endcomponent
**REASON:** {{ $reason }}
Thanks,<br>
{{ config('app.name') }}
@endcomponent

View File

@@ -0,0 +1,26 @@
@component('mail::message',['site'=>$site,'heading'=>'Cancel Service Request'])
Please cancel the following...
@component('mail::table')
| Service | Details |
| :---------- | :---------------- |
| Logged User | {{ Auth::user()->id ?? 'System' }} |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product->name }} |
@switch($service->product->category)
@case('broadband')
| Address | {{ $service->type->service_address }} |
@break;
@case('phone')
| Number | {{ $service->type->service_number }} |
| Supplier Details | {{ $service->order_info->join(':') }} |
@break;
@endswitch
@endcomponent
**NOTES:** {{ $notes }}
Thanks,<br>
{{ config('app.name') }}
@endcomponent

View File

@@ -0,0 +1,26 @@
@component('mail::message',['site'=>$site,'heading'=>'Change Service Request'])
Please change the following...
@component('mail::table')
| Service | Details |
| :---------- | :---------------- |
| Logged User | {{ Auth::user() ? Auth::user()->id : '-' }}
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product->name }} |
@switch($service->product->category)
@case('broadband')
| Address | {{ $service->type->service_address }} |
@break;
@case('phone')
| Number | {{ $service->type->service_number }} |
| Supplier Details | {{ $service->order_info->join(':') }} |
@break;
@endswitch
@endcomponent
**NOTES:** {{ $notes }}
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

@@ -0,0 +1,17 @@
@component('mail::message',['site'=>$site,'heading'=>'Traffic Mismatch: '.$date])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
The traffic import today, had mismatching records. A request to have those login removed has been generated.
@component('mail::table')
| ID |
| - |
@foreach ($aso->trafficMismatch($date) as $o)
| {{ $o->service }}
@endforeach
@endcomponent
Thanks,<br>
{{ config('mail.from.name') }}
@endcomponent

View File

@@ -0,0 +1,21 @@
@component('mail::message',['site'=>$site,'heading'=>'Link Your Account'])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
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::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.
Thanks,
{{ config('mail.from.name') }}
@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

@@ -0,0 +1,11 @@
@component('mail::message',['site'=>$site,'heading'=>'System Test Email'])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
This is just a test email to validate that you can receive emails from us.
Nothing you need to do!
Thanks,
{{ config('mail.from.name') }}
@endcomponent

View File

@@ -0,0 +1,19 @@
@component('mail::message',['site'=>$site,'heading'=>'Password Reset'])
Hi {{ isset($user) ? $user->name_full.',' : '' }}
You are receiving this email because we received a password reset request for your account.
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::button',['url'=>$reset_link])
Reset Password
@endcomponent
@component('mail::subcontent')
Reset password: {{ $reset_link }}
@endcomponent
Thanks,<br>
{{ config('mail.from.name') }}
@endcomponent