Fhernd

AssignmentCreated.php

Jul 10th, 2025
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | Source Code | 0 0
  1. <?php
  2.  
  3. namespace App\Mail;
  4.  
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Mail\Mailable;
  8. use Illuminate\Mail\Mailables\Address;
  9. use Illuminate\Mail\Mailables\Content;
  10. use Illuminate\Mail\Mailables\Envelope;
  11. use Illuminate\Queue\SerializesModels;
  12.  
  13. class AssignmentCreated extends Mailable
  14. {
  15.     use Queueable, SerializesModels;
  16.  
  17.     public function __construct(public $trainer, public $trainee) {}
  18.  
  19.     public function envelope(): Envelope
  20.     {
  21.         return new Envelope(
  22.             subject: 'New assignment from ' . $this->trainer->name,
  23.             from: new Address($this->trainer->email, $this->trainer->name),
  24.         );
  25.     }
  26.  
  27.     public function content(): Content
  28.     {
  29.         return new Content(
  30.             view: 'emails.assignment-created'
  31.         );
  32.     }
  33.  
  34.     public function attachments(): array
  35.     {
  36.         return [];
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment