fix shipping
This commit is contained in:
44
app/Repositories/Shop/OrderMails.php
Normal file
44
app/Repositories/Shop/OrderMails.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Mail\Acheminement;
|
||||
use App\Mail\ConfirmationCommande;
|
||||
use App\Mail\Preparation;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Core\DateStats;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class OrderMails
|
||||
{
|
||||
public static function testSend($id)
|
||||
{
|
||||
self::sendPreparation($id);
|
||||
}
|
||||
|
||||
public static function sendOrderConfirmed($orderId)
|
||||
{
|
||||
$order = Orders::get($orderId, ['customer', 'address']);
|
||||
$mail = new ConfirmationCommande($order);
|
||||
|
||||
return Mail::to($order->customer->email)->send($mail);
|
||||
}
|
||||
|
||||
public static function sendPreparation($orderId)
|
||||
{
|
||||
$order = Orders::get($orderId, ['customer', 'address']);
|
||||
$mail = new Preparation($order);
|
||||
|
||||
return Mail::to($order->customer->email)->send($mail);
|
||||
}
|
||||
|
||||
public static function sendShipping($orderId)
|
||||
{
|
||||
$order = Orders::get($orderId, ['customer', 'address']);
|
||||
$mail = new Acheminement($order);
|
||||
|
||||
return Mail::to($order->customer->email)->send($mail);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user