Support the ongoing development of Laravel.io →
Database Forms Mail
Last updated 2 years ago.
0
$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);

}
Last updated 2 years ago.
0

It wouold be better to put the code in a seperate class or on your model, instead of cluttering up your controller.....

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jerauf jerauf Joined 16 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.