Forum Laravel Getting the $to data inside the mailable
Hi, hope somebody can help me, is there a way to get the $to email address from inside the Mailable file with out passing it from the controller?
Something like: public function __construct() { $this->email = $to;
in case this is not possible, is there a way to append additional data to a Mailable, example:
$message = (new SendEmail($biz))->onConnection('sync'); Then: Mail::to($row)->queue($message, ['email' => $row]); //adding the email to the data
Appreciate any help
Please sign in or create an account to participate in this conversation.
There's no shortage of content at Laracasts. In fact, you could watch nonstop for days upon days, and still not see everything!
Get Started
Getting the $to data inside the mailable
Hi, hope somebody can help me, is there a way to get the $to email address from inside the Mailable file with out passing it from the controller?
Something like: public function __construct() { $this->email = $to;
in case this is not possible, is there a way to append additional data to a Mailable, example:
$message = (new SendEmail($biz))->onConnection('sync'); Then: Mail::to($row)->queue($message, ['email' => $row]); //adding the email to the data
Appreciate any help