$data = array(
'partner' => Input::get('partner'),
'email' => Input::get('email'),
.......
);
$dbData = [your database result as an array of key/value pairs, just as your $data];
$mergedData = array_merge($data, $dbData);
Mail::send('emails.thanks', $mergedData, function($message) use ($mergedData) {
$message->to($mergedData->email, $mergedData->name)->from('[email protected]', 'fromName')
replyTo('[email protected]', 'fromName')->subject($mergedData->subject);
}
It wouold be better to put the code in a seperate class or on your model, instead of cluttering up your controller.....
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community