Send email with blade code

Greetings! Maybe question isn’t 100% related to sage, but i don’t understand how to send email through custom form. Lets assume, that on my custom page.blade.php i have custom form with code:
<form action="" method="POST">
<input type="text" name="name">
<select name="service">
<option selected disabled>Choose service</option>
@foreach ($services as $service)
<option value="{{ $service['title'] }}">{{ $service['title'] }} - {{ $service['price'] }}</option>
@endforeach
</select>
<button type="submit">Send</button>
</form>

And the question is how to send email through this custom form with blade code? What action attribute should i use, maybe there is a plugin to handle custom forms? For example plugin creates /sendemail route and collect all inputs with name attribute…

I know that we can use, for example, contact form7. Create markup in the plugin’s settings and do_shortcode in custom blade template. But contact form7 doesn’t allow to use php/blade code. Please, help me to understand ‘best practises’ how to send custom emails… Thank you!

This topic was automatically closed after 42 days. New replies are no longer allowed.