mardi 3 octobre 2017

PHP Laravel Sending email inside variable to Mail::raw

I've been having this issue where I want to send a plaintext email to a user (me in this case) but the email adress is inside of an object I retrieved from the database. All examples using Mail::raw use a string but not a passed variable. Is there a way to do that?

Code:

Mail::raw($messageContent, function($message)
{
    $message->to($foo->email);
});

This is what I want, in essence. $foo is a variable declared in the function that this is in. I don't want to make $foo a class variable because I am only using it here.

Thanks for helping!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire