0
我想打電話給郵件功能在jQuery的頁面laravel 5.3.I有郵件路由器名稱爲「歡迎郵件」電話郵件功能
Route::get('welcome-mail','[email protected]');
Controller
public function welcomeMail()
{
$to_email = '[email protected]';
Mail::to($to_email)->send(new Reminder);
//return "E-mail has been sent Successfully";
}
mail/Remainder.php
public function build()
{
return $this->from('[email protected]')
->view('email.welcome');
}
view/email/welcome.blade.php
<html>
<body>
<h3>Hi,</h3>
<p>Test mail Travel approval</p>
</body>
</html>
我要調用此函數json響應或json url
if(approve_id=='Y'){
var status = 'approved';
$.ajax({
url: 'request-status',
type: 'GET',
data: {'id':user_id,'status':status,'comment':comment},
dataType: 'JSON',
success: function(data, textStatus, jqXHR){
//alert(data);
url: 'welcome-mail' //want to call like this
$(".table-responsive").load(location.href + " .table-responsive");
},
error: function(jqXHR, textStatus, errorThrown){
// alert('errror');
},
});
}
在我的控制器我嘗試作爲//路線::獲得( '歡迎郵件', 'travelerHome @ welcomeMail'); – user3386779