going to send invitations emails in My Laravel app. But My problem is when I click blade.php for emai send input, it is not open view file and automatically send email without open email input. this is My view file link to email input
<p> <a href="/invs/invitationemail">Invitations</a></p>
EmailsController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Mail;
class EmailsController extends Controller
{
public function send(Request $request)
{
$email = $request->input('email');
Mail::send('emails.send', ['email' => $email], function ($message) use ($email)
{
$message->from('somiyatabara@gmail.com', 'Kurumba');
$message->to('karune@gmail.com');
});
return response()->json(['message' => 'Invitation Email Sent!']);
}
//
}
invitationmail.blade.php
@extends('layouts.app')
<!-- Main Content -->
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Send E-Mail Invitation</div>
<div class="panel-body">
@if (session('status'))
<div class="alert alert-success">
</div>
@endif
<form class="form-horizontal" role="form" method="POST" action="">
<div class="form-group">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="">
@if ($errors->has('email'))
<span class="help-block">
<strong></strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
<i class="fa fa-btn fa-envelope"></i> Send Invitation Link
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
routes
Route::get('invs/invitationemail','EmailsController@send');
how can I solve this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire