E
E
Emil Rakhmatullin2019-10-16 15:03:36
Laravel
Emil Rakhmatullin, 2019-10-16 15:03:36

How to pass variables in Laravel Email message in this case?

I send e-mail messages in this way:

Mail::send(['html' => 'emails.start'], ['user' => $user->name], function($message) use ($user)
{
  $message->from('[email protected]', 'Имя отправителя');
  $message->to($user->email, $user->name)->subject('Тема сообщения.');
});

I need to emails.startpass $request->message.
The documentation doesn't say how to pass when sending goes this way -_-

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2019-10-16
@Emchik

The documentation also does not say that macaques should write code, but after all, they write it without exception
, if you are not a macaque and approach the documentation not as something terrible and pagan, then you can understand that such a possibility is still indicated in the documentation!

['user' => $user->name, 'message' => $request->message]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question