Loc Dai Le
Loc Dai Le

Reputation: 1697

Sending an email which present a blade.php with a HTML form

In Laravel 5.3 I'm sending an email which present a blade.php HTML file. Inside this blade a have a form with a action to a route which is a put. This form is to confirm something, but my form and submit button does not work when clicking in the received email.

What I have tried so far:

<form method="POST" action="http://....dk/public/api/company/{{$company_id}}/user/{{$user_id}}" accept-charset="UTF-8">
  <input type="hidden" name="_method" value="PUT" />
  <input type="submit" value="Acceptere invitationen fra {{$company}}">
</form>

Upvotes: 0

Views: 208

Answers (1)

Lars Mertens
Lars Mertens

Reputation: 1439

You could just link users to the page like this

<a href="http://....dk/public/api/company/{{$company_id}}/user/{{$user_id}}">Acceptere invitationen fra {{$company}}</a>

Instead of post in routes.php use get method instead. Form is not supported by a lot off mail clients. So if you target a larger audience i would suggest using the supported anchor tag.

Upvotes: 2

Related Questions