user9465677
user9465677

Reputation: 427

Laravel 5.1/5.6 How to send a url in email blade

I am using Mail::send function to send emails to my end users with dynamically generated links in them Below is my sample code for the function - $myemail = "some email adderess"; $myurl = "some url that will be emailed";

Mail::send('emails.mybladetemplate', ['myemail' => $myemail] , function ($message) use ($myemail){

$message->subject('Your favorite links');
$message->from('[email protected]', 'Company');
$message->to($myemail);
});

I am having trouble passing $myurl to the blade template and publishing it. I even used HTML{{ }} in my blade template but no success. I have tested Mail::send with other templates and it works fine. Just not when I pass the variables.

Upvotes: 1

Views: 1298

Answers (1)

user9465677
user9465677

Reputation: 427

Added ['myemail' => $myemail, 'myurl' => $myurl] and use ($myemail, $myurl) to solve for it.

Upvotes: 0

Related Questions