inventory source mail

This commit is contained in:
naresh verma 2019-04-09 17:04:20 +05:30
parent 7678593bd4
commit b0296a02e0
10 changed files with 347 additions and 59 deletions

View File

@ -143,7 +143,7 @@ return [
'timeline' => false, // Add the queries to the timeline
'explain' => [ // Show EXPLAIN output on queries
'enabled' => false,
'types' => ['SELECT'], // ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
],
'hints' => true, // Show hints for common mistakes
],

View File

@ -3,6 +3,7 @@
use Maatwebsite\Excel\Excel;
return [
'exports' => [
/*
@ -16,17 +17,6 @@ return [
*/
'chunk_size' => 1000,
/*
|--------------------------------------------------------------------------
| Temporary path
|--------------------------------------------------------------------------
|
| When exporting files, we use a temporary file, before storing
| or downloading. Here you can customize that path.
|
*/
'temp_path' => sys_get_temp_dir(),
/*
|--------------------------------------------------------------------------
| Pre-calculate formulas during export
@ -69,6 +59,23 @@ return [
*/
'formatter' => 'slug',
],
/*
|--------------------------------------------------------------------------
| CSV Settings
|--------------------------------------------------------------------------
|
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
*/
'csv' => [
'delimiter' => ',',
'enclosure' => '"',
'line_ending' => PHP_EOL,
'use_bom' => false,
'include_separator_line' => false,
'excel_compatibility' => false,
],
],
/*
@ -109,4 +116,71 @@ return [
*/
'pdf' => Excel::DOMPDF,
],
'value_binder' => [
/*
|--------------------------------------------------------------------------
| Default Value Binder
|--------------------------------------------------------------------------
|
| PhpSpreadsheet offers a way to hook into the process of a value being
| written to a cell. In there some assumptions are made on how the
| value should be formatted. If you want to change those defaults,
| you can implement your own default value binder.
|
*/
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
],
'transactions' => [
/*
|--------------------------------------------------------------------------
| Transaction Handler
|--------------------------------------------------------------------------
|
| By default the import is wrapped in a transaction. This is useful
| for when an import may fail and you want to retry it. With the
| transactions, the previous import gets rolled-back.
|
| You can disable the transaction handler by setting this to null.
| Or you can choose a custom made transaction handler here.
|
| Supported handlers: null|db
|
*/
'handler' => 'db',
],
'temporary_files' => [
/*
|--------------------------------------------------------------------------
| Local Temporary Path
|--------------------------------------------------------------------------
|
| When exporting and importing files, we use a temporary file, before
| storing reading or downloading. Here you can customize that path.
|
*/
'local_path' => sys_get_temp_dir(),
/*
|--------------------------------------------------------------------------
| Remote Temporary Disk
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup with queues in which you
| cannot rely on having a shared local temporary path, you might
| want to store the temporary file on a shared disk. During the
| queue executing, we'll retrieve the temporary file from that
| location instead. When left to null, it will always use
| the local path. This setting only has effect when using
| in conjunction with queued imports and exports.
|
*/
'remote_disk' => null,
],
];

View File

@ -28,6 +28,8 @@ return [
|
*/
'dont_alias' => [],
'dont_alias' => [
'App\Nova',
],
];

View File

@ -39,6 +39,8 @@ return [
| As a default locale, Translatable takes the locale of Laravel's
| translator. If for some reason you want to override this,
| you can specify what default should be used here.
| If you set a value here it will only use the current config value
| and never fallback to the translator one.
|
*/
'locale' => null,
@ -54,7 +56,7 @@ return [
| $useTranslationFallback when defined
|
*/
'use_fallback' => true,
'use_fallback' => false,
/*
|--------------------------------------------------------------------------
@ -80,6 +82,18 @@ return [
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Translation Model Namespace
|--------------------------------------------------------------------------
|
| Defines the default 'Translation' class namespace. For example, if
| you want to use App\Translations\CountryTranslation instead of App\CountryTranslation
| set this to 'App\Translations'.
|
*/
'translation_model_namespace' => null,
/*
|--------------------------------------------------------------------------
| Translation Suffix
@ -113,4 +127,4 @@ return [
|
*/
'to_array_always_loads_translations' => true,
];
];

View File

@ -15,19 +15,20 @@ return [
* of your proxy (e.g. if using ELB or similar).
*
*/
'proxies' => null, // [<ip addresses>,], '*'
'proxies' => null, // [<ip addresses>,], '*', '<ip addresses>,'
/*
* To trust one or more specific proxies that connect
* directly to your server, use an array of IP addresses:
* directly to your server, use an array or a string separated by comma of IP addresses:
*/
# 'proxies' => ['192.168.1.1'],
// 'proxies' => ['192.168.1.1'],
// 'proxies' => '192.168.1.1, 192.168.1.2',
/*
* Or, to trust all proxies that connect
* directly to your server, use a "*"
*/
# 'proxies' => '*',
// 'proxies' => '*',
/*
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
@ -36,10 +37,14 @@ return [
*
* - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
* - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
* - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer)
*
* - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust)
* - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust)
* - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer)
*
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
];

View File

@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Mail;
use Webkul\Admin\Mail\NewOrderNotification;
use Webkul\Admin\Mail\NewInvoiceNotification;
use Webkul\Admin\Mail\NewShipmentNotification;
use Webkul\Admin\Mail\NewInventorySourceNotification;
/**
* Order event handler
@ -18,7 +19,7 @@ class Order {
/**
* @param mixed $order
*
* Send new order confirmation mail to the customer
* Send new shipment mail to the customer and inventory source
*/
public function sendNewOrderMail($order)
{
@ -52,6 +53,8 @@ class Order {
{
try {
Mail::send(new NewShipmentNotification($shipment));
Mail::send(new NewInventorySourceNotification($shipment));
} catch (\Exception $e) {
}

View File

@ -0,0 +1,51 @@
<?php
namespace Webkul\Admin\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
/**
* New InventorySource Notification Mail class
*
* @author Jitendra Singh <jitendra@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class NewInventorySourceNotification extends Mailable
{
use Queueable, SerializesModels;
/**
* The shipment instance.
*
* @var Shipment
*/
public $shipment;
/**
* Create a new message instance.
*
* @param mixed $shipment
* @return void
*/
public function __construct($shipment)
{
$this->shipment = $shipment;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{ $order = $this->shipment->order;
$inventory = $this->shipment->inventory_source;
return $this->to($inventory->contact_email, $inventory->name)
->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->id]))
->view('shop::emails.sales.new-inventorysource-shipment');
}
}

View File

@ -479,11 +479,12 @@ return [
'summary' => 'Summary of Invoice',
],
'shipment' => [
'heading' => 'Your Shipment #:shipment_id for Order #:order_id',
'heading' => 'Shipment #:shipment_id has been generated for Order #:order_id',
'subject' => 'Shipment for your order #:order_id',
'summary' => 'Summary of Shipment',
'carrier' => 'Carrier',
'tracking-number' => 'Tracking Number'
'tracking-number' => 'Tracking Number',
'greeting' => 'An Order :order_id has been placed on :created_at',
],
'forget-password' => [
'dear' => 'Dear :name',

View File

@ -0,0 +1,145 @@
@component('shop::emails.layouts.master')
<div style="text-align: center;">
<a href="{{ config('app.url') }}">
<img src="{{ bagisto_asset('images/logo.svg') }}">
</a>
</div>
<?php $order = $shipment->order; ?>
<?php $inventory = $shipment->inventory_source; ?>
<div style="padding: 30px;">
<div style="font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 34px;">
<span style="font-weight: bold;">
{{ __('shop::app.mail.shipment.heading', ['order_id' => $order->id, 'shipment_id' => $shipment->id]) }}
</span> <br>
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{{ __('shop::app.mail.order.dear', ['customer_name' => $inventory->name]) }},
</p>
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!! __('shop::app.mail.shipment.greeting', [
'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>',
'created_at' => $order->created_at
])
!!}
</p>
</div>
<div style="display: flex;flex-direction: row;margin-top: 20px;justify-content: space-between;margin-bottom: 40px;">
<div style="line-height: 25px;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.shipping-address') }}
</div>
<div>
{{ $order->shipping_address->name }}
</div>
<div>
{{ $order->shipping_address->address1 }}, {{ $order->shipping_address->state }}
</div>
<div>
{{ country()->name($order->shipping_address->country) }} {{ $order->shipping_address->postcode }}
</div>
<div>---</div>
<div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
</div>
<div style="font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.shipping') }}
</div>
<div style="font-size: 16px;color: #242424;">
<div style="font-weight: bold;">
{{ $order->shipping_title }}
</div>
<div style="margin-top: 5px;">
<span style="font-weight: bold;">{{ __('shop::app.mail.shipment.carrier') }} : </span>{{ $shipment->carrier_title }}
</div>
<div style="margin-top: 5px;">
<span style="font-weight: bold;">{{ __('shop::app.mail.shipment.tracking-number') }} : </span>{{ $shipment->track_number }}
</div>
</div>
</div>
<div style="line-height: 25px;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.billing-address') }}
</div>
<div>
{{ $order->billing_address->name }}
</div>
<div>
{{ $order->billing_address->address1 }}, {{ $order->billing_address->state }}
</div>
<div>
{{ country()->name($order->billing_address->country) }} {{ $order->billing_address->postcode }}
</div>
<div>---</div>
<div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
</div>
<div style="font-size: 16px; color: #242424;">
{{ __('shop::app.mail.order.payment') }}
</div>
<div style="font-weight: bold;font-size: 16px; color: #242424;">
{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}
</div>
</div>
</div>
<div class="section-content">
<div class="table mb-20">
<table style="overflow-x: auto; border-collapse: collapse;
border-spacing: 0;width: 100%">
<thead>
<tr style="background-color: #f2f2f2">
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.SKU') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
</tr>
</thead>
<tbody>
@foreach ($shipment->items as $item)
<tr>
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}" style="text-align: left;padding: 8px">{{ $item->child ? $item->child->sku : $item->sku }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}" style="text-align: left;padding: 8px">{{ $item->name }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}" style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}" style="text-align: left;padding: 8px">{{ $item->qty }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
{{-- <div style="margin-top: 20px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%">
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!!
__('shop::app.mail.order.help', [
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>'
])
!!}
</p>
</div> --}}
</div>
@endcomponent

View File

@ -21,7 +21,7 @@
{!! __('shop::app.mail.order.greeting', [
'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>',
'created_at' => $order->created_at
])
])
!!}
</p>
</div>
@ -51,7 +51,7 @@
<div>---</div>
<div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
</div>
<div style="font-size: 16px;color: #242424;">
@ -93,7 +93,7 @@
<div>---</div>
<div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
</div>
<div style="font-size: 16px; color: #242424;">
@ -106,46 +106,39 @@
</div>
</div>
@foreach ($shipment->items as $item)
<div style="background: #FFFFFF;border: 1px solid #E8E8E8;border-radius: 3px;padding: 20px;margin-bottom: 10px">
<p style="font-size: 18px;color: #242424;line-height: 24px;margin-top: 0;margin-bottom: 10px;font-weight: bold;">
{{ $item->name }}
</p>
<div class="section-content">
<div class="table mb-20">
<table style="overflow-x: auto; border-collapse: collapse;
border-spacing: 0;width: 100%">
<thead>
<tr style="background-color: #f2f2f2">
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.SKU') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
</tr>
</thead>
<div style="margin-bottom: 10px;">
<label style="font-size: 16px;color: #5E5E5E;">
{{ __('shop::app.mail.order.price') }}
</label>
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;">
{{ core()->formatPrice($item->price, $order->order_currency_code) }}
</span>
</div>
<div style="margin-bottom: 10px;">
<label style="font-size: 16px;color: #5E5E5E;">
{{ __('shop::app.mail.order.quantity') }}
</label>
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;">
{{ $item->qty }}
</span>
</div>
@if ($html = $item->getOptionDetailHtml())
<div style="">
<label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;">
{{ $html }}
</label>
</div>
@endif
<tbody>
@foreach ($shipment->items as $item)
<tr>
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}" style="text-align: left;padding: 8px">{{ $item->child ? $item->child->sku : $item->sku }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}" style="text-align: left;padding: 8px">{{ $item->name }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}" style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}" style="text-align: left;padding: 8px">{{ $item->qty }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endforeach
</div>
<div style="margin-top: 20px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%">
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!!
{!!
__('shop::app.mail.order.help', [
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>'
])
])
!!}
</p>