Minor updates to order process
This commit is contained in:
55
app/Mail/OrderRequest.php
Normal file
55
app/Mail/OrderRequest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
use App\Models\Service;
|
||||
|
||||
class OrderRequest extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $service;
|
||||
public $notes;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param Service $o
|
||||
* @param string $notes
|
||||
*/
|
||||
public function __construct(Service $o,$notes='')
|
||||
{
|
||||
$this->service = $o;
|
||||
$this->notes = $notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
switch ($this->service->category)
|
||||
{
|
||||
case 'ADSL': $subject = sprintf('%s: %s',$this->service->category,$this->service->service_adsl->service_address);
|
||||
break;
|
||||
|
||||
case 'VOIP': $subject = sprintf('%s: %s',$this->service->category,$this->service->service_voip->service_number);
|
||||
break;
|
||||
|
||||
default:
|
||||
$subject = 'New Order Request';
|
||||
}
|
||||
|
||||
return $this
|
||||
->markdown('email.admin.order.approve')
|
||||
->subject($subject)
|
||||
->with(['site'=>$this->service->site]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user