Examples of code I've written in PHP, Javascript, SCSS, etc.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

50 lignes
974 B

  1. <?php
  2. namespace App\Mail;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Mail\Mailable;
  6. use Illuminate\Queue\SerializesModels;
  7. use Illuminate\Support\Facades\Log;
  8. use App\Models\Ticket;
  9. class SupportTicket extends Mailable
  10. {
  11. use Queueable, SerializesModels;
  12. /**
  13. * Create a new message instance.
  14. *
  15. * @return void
  16. */
  17. public $name;
  18. public $email;
  19. public $user_message;
  20. public $type;
  21. public $id;
  22. public function __construct(Ticket $ticket, String $user_message)
  23. {
  24. $this->name = $ticket->user->name;
  25. $this->email = $ticket->user->email;
  26. $this->user_message = $user_message;
  27. $this->type = $ticket->type;
  28. $this->id = $ticket->id;
  29. }
  30. /**
  31. * Build the message.
  32. *
  33. * @return $this
  34. */
  35. public function build()
  36. {
  37. $this->view('support-ticket');
  38. $this->subject("Ticket: $this->id, $this->type");
  39. $this->replyTo($this->email);
  40. return $this;
  41. }
  42. }