Did you create a OrderShipped mailable?
Oct 26, 2019
31
Level 27
Sending email
I am trying to understand the concept of sending email.
contact.blade.php
<form class="form-horizontal" action="" method="POST">
<div class="form-group">
<label class="control-label col-sm-2" for="email">Nama:</label>
<div class="col-sm-4">
<input type="email" class="form-control" name="nama" id="email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Email:</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="email" id="pwd" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Nomor Telepon:</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="telp" id="pwd" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Type Proyek:</label>
<div class="col-sm-4">
<select class="form-control" name="project">
<option value="Project1">Project1</option>
<option value="Project2">Project2</option>
<option value="Project3">Project3</option>
<option value="Project4">Project4</option>
<option value="Project5">Project5</option>
<option value="Project6">Project6</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Pesan:</label>
<div class="col-sm-4">
<textarea name="pesan" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</div>
</form>
FPController.php
public function sendmail()
{
Mail::to($request->user())
->send(new OrderShipped($order));
Session::flash('flash', 'successfully send email');
return view('contact');
}
web.php
Route::post('/sendmail', 'FPController@sendmail');
I am not sure how to send the information from contact page to the intended email address?
Level 102
Oh yeah missed that. Should be something like
public function __construct($data)
{
//
$this->name = $data['name'];
$this->email = $data['email'];
Please or to participate in this conversation.