TicketClosed.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Notifications\Messages\MailMessage;
  6. use Illuminate\Notifications\Notification;
  7. class TicketClosed extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. private $title;
  11. private $url;
  12. private $reason;
  13. public function __construct($id, $title, $url, $reason)
  14. {
  15. $this->id = $id;
  16. $this->title = $title;
  17. $this->url = $url;
  18. $this->reason = $reason;
  19. }
  20. public function via($notifiable)
  21. {
  22. return sysConfig('ticket_closed_notification');
  23. }
  24. public function toMail($notifiable)
  25. {
  26. return (new MailMessage)
  27. ->subject(trans('close_ticket', ['id' => $this->id, 'title' => $this->title]))
  28. ->line($this->reason)
  29. ->action(trans('notification.view_ticket'), $this->url)
  30. ->line(__('If your problem has not been solved, Feel free to open other one.'));
  31. }
  32. public function toArray($notifiable)
  33. {
  34. return [
  35. ];
  36. }
  37. }