I know this question is asked many times but I could not found the answer I am using this method to sending email
Mail::send('dynamic_email_template',$data, function ($message) {
$message->from('sales@scoopscreamery.pk', 'Contact');
$message->to('hamzaqureshi401@gmail.com')->subject('Contact');
});
and getting this error No hint path defined for [mail].
the error cause is i am sending table in email using @component('mail::table') in dynamic blade view so then i tried to differernt technique of code but in this i am getting mail but without (user input) {{ $name }} , {{ $email }} , {{ $messae1 }} can any one help me
yo get input data in email
controller
$data = [
'name' => $request->name,
'email' => $request->email,
'message1' => $request->message1
];
Mail::to('hamzaqureshi401@gmail.com')->send(new \App\Mail\SendMail($data));
my model is
class SendMail extends Mailable
{
use Queueable, SerializesModels;
public $data;
public function __construct(array $data)
{
$this->data = $data;
}
public function build()
{
return $this->subject('Mail from Online Web Tutor')
->markdown('dynamic_email_template',['data'=>$this->data]);
}
and my dynamic blade is
<p>Hi, This is {{ $name }}</p>
<p>I have some query like {{ $email }}.</p>
<p>It would be appriciative, if you gone through this feedback {{ $message1 }}.</p>
@component('mail::table')
| Laravel | Table | Example |
| ------------- |:-------------:| --------:|
| Col 2 is | Centered | $10 |
| Col 3 is | Right-Aligned | $20 |
@endcomponent
the error cause is I am sending table in email using @component('mail::table') in dynamic blade view so then I tried to differernt technique of code but in this I am getting mail but without (user input) {{ $name }} , {{ $email }} , {{ $messae1 }} can any one help me yo get input data in email