-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathNewLeadSubmitted.php
More file actions
37 lines (31 loc) · 1.12 KB
/
NewLeadSubmitted.php
File metadata and controls
37 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace App\Notifications;
use App\Models\Lead;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class NewLeadSubmitted extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public Lead $lead
) {}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('New Consulting Enquiry: '.$this->lead->company)
->replyTo($this->lead->email, $this->lead->name)
->greeting('New lead received!')
->line("**Name:** {$this->lead->name}")
->line("**Email:** {$this->lead->email}")
->line("**Company:** {$this->lead->company}")
->when($this->lead->budget, fn (MailMessage $message) => $message->line("**Budget:** {$this->lead->budget_label}"))
->line('**Project Description:**')
->line($this->lead->description);
}
}