Service cancellation and ordering
This commit is contained in:
56
app/Mail/CancelRequest.php
Normal file
56
app/Mail/CancelRequest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
use App\Models\Service;
|
||||
|
||||
class CancelRequest extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public Service $service;
|
||||
public string $notes;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param Service $o
|
||||
* @param string $notes
|
||||
*/
|
||||
public function __construct(Service $o,string $notes='')
|
||||
{
|
||||
$this->service = $o;
|
||||
$this->notes = $notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
switch (get_class($this->service->type)) {
|
||||
case 'App\Models\Service\Adsl':
|
||||
$subject = sprintf('CANCEL NBN: %s',$this->service->type->service_address);
|
||||
break;
|
||||
|
||||
case 'App\Models\Service\Voip':
|
||||
$subject = sprintf('CANCEL VOIP: %s',$this->service->type->service_number);
|
||||
break;
|
||||
|
||||
default:
|
||||
$subject = 'Cancel Service Request';
|
||||
}
|
||||
|
||||
return $this
|
||||
->markdown('email.admin.service.cancel')
|
||||
->subject($subject)
|
||||
->with(['site'=>$this->service->site]);
|
||||
}
|
||||
}
|
56
app/Mail/ChangeRequest.php
Normal file
56
app/Mail/ChangeRequest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
use App\Models\Service;
|
||||
|
||||
class ChangeRequest extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public Service $service;
|
||||
public string $notes;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param Service $o
|
||||
* @param string $notes
|
||||
*/
|
||||
public function __construct(Service $o,string $notes='')
|
||||
{
|
||||
$this->service = $o;
|
||||
$this->notes = $notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
switch (get_class($this->service->type)) {
|
||||
case 'App\Models\Service\Adsl':
|
||||
$subject = sprintf('Change NBN: %s',$this->service->type->service_address);
|
||||
break;
|
||||
|
||||
case 'App\Models\Service\Voip':
|
||||
$subject = sprintf('Change VOIP: %s',$this->service->type->service_number);
|
||||
break;
|
||||
|
||||
default:
|
||||
$subject = 'Change Service Request';
|
||||
}
|
||||
|
||||
return $this
|
||||
->markdown('email.admin.service.change')
|
||||
->subject($subject)
|
||||
->with(['site'=>$this->service->site]);
|
||||
}
|
||||
}
|
@@ -3,9 +3,9 @@
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
use App\Models\Service;
|
||||
|
||||
@@ -13,8 +13,8 @@ class OrderRequest extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $service;
|
||||
public $notes;
|
||||
public Service $service;
|
||||
public string $notes;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
@@ -22,7 +22,7 @@ class OrderRequest extends Mailable
|
||||
* @param Service $o
|
||||
* @param string $notes
|
||||
*/
|
||||
public function __construct(Service $o,$notes='')
|
||||
public function __construct(Service $o,string $notes='')
|
||||
{
|
||||
$this->service = $o;
|
||||
$this->notes = $notes;
|
||||
@@ -35,8 +35,7 @@ class OrderRequest extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
switch (get_class($this->service->type))
|
||||
{
|
||||
switch (get_class($this->service->type)) {
|
||||
case 'App\Models\Service\Adsl':
|
||||
$subject = sprintf('NBN: %s',$this->service->type->service_address);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user