74 lines
1.9 KiB
PHP
74 lines
1.9 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Mail\Frontend;
|
||
|
|
|
||
|
|
use Illuminate\Bus\Queueable;
|
||
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
|
|
use Illuminate\Mail\Mailable;
|
||
|
|
use Illuminate\Mail\Mailables\Content;
|
||
|
|
use Illuminate\Mail\Mailables\Envelope;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
use App\Models\Admin\mail_template;
|
||
|
|
use View;
|
||
|
|
|
||
|
|
|
||
|
|
class AdminNotificationEmail extends Mailable
|
||
|
|
{
|
||
|
|
use Queueable, SerializesModels;
|
||
|
|
public $contact;
|
||
|
|
/**
|
||
|
|
* Create a new message instance.
|
||
|
|
*/
|
||
|
|
public function __construct($contact)
|
||
|
|
{
|
||
|
|
$this->contact = $contact;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the message envelope.
|
||
|
|
*/
|
||
|
|
// public function envelope(): Envelope
|
||
|
|
// {
|
||
|
|
// return new Envelope(
|
||
|
|
// subject: 'Admin Notification Email',
|
||
|
|
// );
|
||
|
|
// }
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the message content definition.
|
||
|
|
*/
|
||
|
|
// public function content(): Content
|
||
|
|
// {
|
||
|
|
// return new Content(
|
||
|
|
// view: 'Frontend.Templates.contact_us_mailto_admin',
|
||
|
|
// );
|
||
|
|
// }
|
||
|
|
|
||
|
|
public function build()
|
||
|
|
{
|
||
|
|
$mailDescription = mail_template::find(7);
|
||
|
|
$predefinedValues = ['{{$name}}','{{$email}}','{{$title}}','{{$message}}'];
|
||
|
|
$newValues = [$this->contact['name'],$this->contact['email'],$this->contact['title'],$this->contact['message']];
|
||
|
|
$mailData = str_replace($predefinedValues,$newValues,$mailDescription->description);
|
||
|
|
|
||
|
|
return $this->subject('Mail from Lean In World')
|
||
|
|
->view('Frontend.Templates.contact_us_mailto_admin',["content"=>$mailData]);
|
||
|
|
|
||
|
|
|
||
|
|
// $data = $this->contact;
|
||
|
|
// return $this->subject('Mail from Remider')
|
||
|
|
// ->view('Frontend.Templates.contact_us_mailto_admin')
|
||
|
|
// ->with(['data' => $data]);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the attachments for the message.
|
||
|
|
*
|
||
|
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||
|
|
*/
|
||
|
|
public function attachments(): array
|
||
|
|
{
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
}
|