89 lines
2.2 KiB
PHP
89 lines
2.2 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 ContactUsMail 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: 'Inquiry/Request for Contact Leaninworld.org',
|
|
// );
|
|
// }
|
|
|
|
/**
|
|
* Get the message content definition.
|
|
*/
|
|
// public function content(): Content
|
|
// {
|
|
// return new Content(
|
|
// view: 'Frontend.Templates.contact_us',
|
|
// );
|
|
// }
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
// $data = $this->contact;
|
|
// dd($data);
|
|
// #attributes: array:7 [
|
|
// "name" => "Megha Ganesh Malore"
|
|
// "email" => "megha@wdimails.com"
|
|
// "title" => "Enquirry"
|
|
// "message" => "EnquirryEnquirryEnquirryEnquirryEnquirry"
|
|
// "updated_at" => "2023-11-07 06:57:51"
|
|
// "created_at" => "2023-11-07 06:57:51"
|
|
// "id" => 61
|
|
// ]
|
|
|
|
$mailDescription = mail_template::find(6);
|
|
$predefinedValues = ['{{$name}}'];
|
|
$newValues = [$this->contact['name']];
|
|
$mailData = str_replace($predefinedValues,$newValues,$mailDescription->description);
|
|
|
|
return $this->subject('Mail from Lean In World')
|
|
->view('Frontend.Templates.contact_us',["content"=>$mailData]);
|
|
|
|
// $data = $this->contact;
|
|
// return $this->subject('Mail from Lean In World')
|
|
// ->view('Frontend.Templates.contact_us')
|
|
// ->with(['data' => $data]);
|
|
}
|
|
|
|
/**
|
|
* Get the attachments for the message.
|
|
*
|
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|