| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace App\Mail;
- /*
- * LeadNotification — письмо-уведомление о новой заявке с сайта.
- * Отправляется на notify_email формы сразу после сохранения Lead.
- * Содержит: название формы, все поля заявки, дата и IP.
- */
- use App\Models\Lead;
- use App\Models\WebForm;
- use Illuminate\Bus\Queueable;
- use Illuminate\Mail\Mailable;
- use Illuminate\Mail\Mailables\Content;
- use Illuminate\Mail\Mailables\Envelope;
- use Illuminate\Queue\SerializesModels;
- class LeadNotification extends Mailable
- {
- use Queueable, SerializesModels;
- public function __construct(
- public readonly Lead $lead,
- public readonly WebForm $form,
- ) {}
- public function envelope(): Envelope
- {
- return new Envelope(
- subject: 'Новая заявка: '.$this->form->title,
- );
- }
- public function content(): Content
- {
- return new Content(
- markdown: 'mail.lead-notification',
- with: [
- 'lead' => $this->lead,
- 'form' => $this->form,
- ],
- );
- }
- public function attachments(): array
- {
- return [];
- }
- }
|