TicketReplied.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 TicketReplied extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. private $title;
  11. private $content;
  12. private $url;
  13. public function __construct($title, $content, $url)
  14. {
  15. $this->title = $title;
  16. $this->content = $content;
  17. $this->url = $url;
  18. }
  19. public function via($notifiable)
  20. {
  21. return sysConfig('ticket_replied_notification');
  22. }
  23. public function toMail($notifiable)
  24. {
  25. return (new MailMessage)
  26. ->subject(trans('notification.reply_ticket', ['title' => $this->title]))
  27. ->line(trans('notification.ticket_content'))
  28. ->line($this->content)
  29. ->action(trans('notification.view_ticket'), $this->url);
  30. }
  31. public function toArray($notifiable)
  32. {
  33. return [
  34. //
  35. ];
  36. }
  37. }