New notification page..
This commit is contained in:
@@ -11,6 +11,10 @@ class ExportCompleted extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
protected $translation;
|
||||
|
||||
protected $file_name;
|
||||
|
||||
protected $download_url;
|
||||
|
||||
/**
|
||||
@@ -18,8 +22,10 @@ class ExportCompleted extends Notification implements ShouldQueue
|
||||
*
|
||||
* @param string $download_url
|
||||
*/
|
||||
public function __construct($download_url)
|
||||
public function __construct($translation, $file_name, $download_url)
|
||||
{
|
||||
$this->translation = $translation;
|
||||
$this->file_name = $file_name;
|
||||
$this->download_url = $download_url;
|
||||
|
||||
$this->onQueue('notifications');
|
||||
@@ -33,7 +39,7 @@ class ExportCompleted extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail'];
|
||||
return ['mail', 'database'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,4 +55,19 @@ class ExportCompleted extends Notification implements ShouldQueue
|
||||
->line(trans('notifications.export.completed.description'))
|
||||
->action(trans('general.download'), $this->download_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
'translation' => $this->translation,
|
||||
'file_name' => $this->file_name,
|
||||
'download_url' => $this->download_url,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,18 +14,18 @@ class ExportFailed extends Notification implements ShouldQueue
|
||||
/**
|
||||
* The error exception.
|
||||
*
|
||||
* @var object
|
||||
* @var string
|
||||
*/
|
||||
public $exception;
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* Create a notification instance.
|
||||
*
|
||||
* @param object $exception
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct($exception)
|
||||
public function __construct($message)
|
||||
{
|
||||
$this->exception = $exception;
|
||||
$this->message = $message;
|
||||
|
||||
$this->onQueue('notifications');
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class ExportFailed extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail'];
|
||||
return ['mail', 'database'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,6 +52,19 @@ class ExportFailed extends Notification implements ShouldQueue
|
||||
return (new MailMessage)
|
||||
->subject(trans('notifications.export.failed.subject'))
|
||||
->line(trans('notifications.export.failed.description'))
|
||||
->line($this->exception->getMessage());
|
||||
->line($this->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
'message' => $this->message,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,14 @@ class PaymentReceived extends Notification
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
'template_alias' => $this->template->alias,
|
||||
'invoice_id' => $this->invoice->id,
|
||||
'invoice_number' => $this->invoice->document_number,
|
||||
'customer_name' => $this->invoice->contact_name,
|
||||
'amount' => $this->invoice->amount,
|
||||
'invoice_at' => $this->invoice->issued_at,
|
||||
'due_at' => $this->invoice->due_at,
|
||||
'status' => $this->invoice->status,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,14 @@ class Bill extends Notification
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
'template_alias' => $this->template->alias,
|
||||
'bill_id' => $this->bill->id,
|
||||
'bill_number' => $this->bill->document_number,
|
||||
'vendor_name' => $this->bill->contact_name,
|
||||
'amount' => $this->bill->amount,
|
||||
'billed_date' => company_date($this->bill->issued_at),
|
||||
'bill_due_date' => company_date($this->bill->due_at),
|
||||
'status' => $this->bill->status,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -68,6 +74,7 @@ class Bill extends Notification
|
||||
'{bill_number}',
|
||||
'{bill_total}',
|
||||
'{bill_amount_due}',
|
||||
'{billed_date}',
|
||||
'{bill_due_date}',
|
||||
'{bill_admin_link}',
|
||||
'{vendor_name}',
|
||||
|
||||
@@ -77,8 +77,14 @@ class Invoice extends Notification
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
'template_alias' => $this->template->alias,
|
||||
'invoice_id' => $this->invoice->id,
|
||||
'invoice_number' => $this->invoice->document_number,
|
||||
'customer_name' => $this->invoice->contact_name,
|
||||
'amount' => $this->invoice->amount,
|
||||
'invoiced_date' => company_date($this->invoice->issued_at),
|
||||
'invoice_due_date' => company_date($this->invoice->due_at),
|
||||
'status' => $this->invoice->status,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -88,6 +94,7 @@ class Invoice extends Notification
|
||||
'{invoice_number}',
|
||||
'{invoice_total}',
|
||||
'{invoice_amount_due}',
|
||||
'{invoiced_date}',
|
||||
'{invoice_due_date}',
|
||||
'{invoice_guest_link}',
|
||||
'{invoice_admin_link}',
|
||||
|
||||
Reference in New Issue
Block a user