2
How can I make mail.php take the logged user data leaving the data of retemente dynamic. In the controller works, I can access the password of the logged in user. The problem is that in mail.php if I do not describe the email does not work.
Controller
use Auth;
use Mail;
$email = Auth::user()->email;
$username = Auth::user()->username;
$emails = ["[email protected]", "[email protected]"];
$copias = ["[email protected]"];
$beautyemail = app()->make(\Snowfire\Beautymail\Beautymail::class);
$beautyemail->send('dashboard.templateemail', [
'email' => $template,
'first_name' => $first_name,
'last_name' => $last_name,
'id' => $id, 'cargo' => $cargo,
'phone' => $phone,
'ramal' => $ramal,
'finalizacaodoemail' => $finalizacaodoemail
], function($m) use ($emails, $assunto, $copias, $template, $finalizacaodoemail, $email, $username) {
$m->to($emails)->subject($assunto)->from($email, $username)->cc($copias);
});
Mail.php
'username' => "[email protected]",
'password' => "senha123",
Wouldn’t be the Configuring the Sender described in the documentation?
– Woss
You use some Controller to send?
– Darlei Fernando Zillmer
@Darleifernandozillmer yes, use, updated the question with the controller code, and mail.php, what happens is that if the user’s meial is not equal to what is in maisl.php an authentication error. What I wanted to do was in mail.php already trying to get email and password from the logged-in user.
– Lorena
First thing
mail.php
is the fixed configuration file inside the folderconfig
?– novic