|
|
@@ -13,20 +13,24 @@ class SendEmailNotification extends Notification implements ShouldQueue
|
|
|
|
|
|
public $objToJson;
|
|
|
|
|
|
+ public $view;
|
|
|
+
|
|
|
/**
|
|
|
* SendEmailNotification constructor.
|
|
|
* @param $objToJson
|
|
|
+ * @param $view
|
|
|
*/
|
|
|
- public function __construct($objToJson)
|
|
|
+ public function __construct($objToJson, $view)
|
|
|
{
|
|
|
$this->objToJson = $objToJson;
|
|
|
+ $this->view = $view;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Get the notification's delivery channels.
|
|
|
*
|
|
|
- * @param mixed $notifiable
|
|
|
+ * @param mixed $notifiable
|
|
|
* @return array
|
|
|
*/
|
|
|
public function via($notifiable): array
|
|
|
@@ -37,21 +41,22 @@ class SendEmailNotification extends Notification implements ShouldQueue
|
|
|
/**
|
|
|
* Get the mail representation of the notification.
|
|
|
*
|
|
|
- * @param mixed $notifiable
|
|
|
+ * @param mixed $notifiable
|
|
|
* @return MailMessage
|
|
|
*/
|
|
|
public function toMail($notifiable): MailMessage
|
|
|
{
|
|
|
$template = json_decode($this->objToJson);
|
|
|
+ $view = $this->view ? $this->view : 'emails.test';
|
|
|
return (new MailMessage)->view(
|
|
|
- 'emails.test', ['objToJson' => $template]
|
|
|
+ $view, ['objToJson' => $template]
|
|
|
)->subject($template->title);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Get the array representation of the notification.
|
|
|
*
|
|
|
- * @param mixed $notifiable
|
|
|
+ * @param mixed $notifiable
|
|
|
* @return array
|
|
|
*/
|
|
|
public function toArray($notifiable)
|