v0.8.0
This commit is contained in:
commit
bf5c31169a
221 files changed
+16292
No files matched your search
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace IriksIT\Manager\Mail;
|
||||
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use IriksIT\Manager\Models\Lead;
|
||||
|
||||
/** A short confirmation to the visitor with what was sent (`manager.leads.confirm`, off by default). View: `manager::mail.lead-confirmation`. */
|
||||
class LeadConfirmation extends Mailable
|
||||
{
|
||||
public function __construct(public Lead $lead) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(subject: (string) __('We received your message'));
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(view: 'manager::mail.lead-confirmation', with: ['lead' => $this->lead]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace IriksIT\Manager\Mail;
|
||||
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Address;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use IriksIT\Manager\Models\Lead;
|
||||
use IriksIT\Manager\Support\Leads\Phone;
|
||||
|
||||
/**
|
||||
* Tells the owner about a new request with the same three buttons as the manager: call, WhatsApp, mail. Sent by the site from its own
|
||||
* address; the visitor is the Reply-To, never the sender (that fails the checks of mail providers). The view `manager::mail.lead-received`
|
||||
* can be replaced by a site (resources/views/vendor/manager/mail/lead-received.blade.php).
|
||||
*/
|
||||
class LeadReceived extends Mailable
|
||||
{
|
||||
public function __construct(public Lead $lead) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->lead->kindLabel().' — '.$this->lead->name.($this->lead->subject ? ': '.$this->lead->subject : ''),
|
||||
replyTo: $this->lead->email ? [new Address($this->lead->email, $this->lead->name)] : [],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
$digits = $this->lead->phone ? Phone::international($this->lead->phone) : null;
|
||||
|
||||
return new Content(view: 'manager::mail.lead-received', with: [
|
||||
'lead' => $this->lead,
|
||||
'callLink' => $digits ? 'tel:+'.$digits : null,
|
||||
'whatsappLink' => $digits ? 'https://wa.me/'.$digits : null,
|
||||
'mailLink' => $this->lead->email ? 'mailto:'.$this->lead->email : null,
|
||||
'managerLink' => url(config('manager.path').'/leads').'?open='.$this->lead->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user