jeudi 25 octobre 2018

call client email address while sending email in laravel

i am sending email my code is like this

public function postApprovedDemand( Demandrequest $demand){
$reuestemail = $demand->email;
$gettoken = $demand->token;
$get_id = $demand->id;
$approvedlink = 'example.com/'.$gettoken.'/'.$get_id;
$data = array(
    'name' => $demand->name,
     'demail'=>$demand->email,
      'token'=>$demand->token,
     'link'=>$approvedlink
);
 Mail::send('mail.projectrequest', $data, function ($message) {
    $message->from('info@example.com');
    $message->to($requestemail);
    $message->subject('Demand Request link');
});
return redirect()->back()->with('message', 'Demark form link has been send successfully.');}

while i am sending the email its say $requestemail not found. if i direct type email its working. My question is how i pass the $requestemail = $demand->email in $message->to(???????). i am using laravel 6.5.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire