Open D-sense opened 5 years ago
You'll have to use inheritance see anonymous functions here https://www.php.net/manual/en/functions.anonymous.php
Step 3 is what you're after
$user_email_address = 'foo@bar.com';
Mailgun::send('foo.bar', ['foo' => 'bar], function ($message) use ($user_email_address) {
$message->to($user_email_address, 'John Doe');
});
Note the keyword use
Hi,
I get an error each time I try passing a variable to the to(). Example: ->to($user_email_address, 'John Doe')
In addition, is it possible to use this with Mailable? Like passing mailable as opposed to passing email path?
Is there any way around this? Thanks