Hello. I am using the email contact form of the uniform.
Currently, even if I send a message on my uniform, I don’t see a success message or a fail message in my uniform.
How do I put this in?
<?php
use Uniform\Form;
return function ($kirby)
{
$form = new Form([
'name' => [
'rules' => ['required'],
'message' => 'Name is required',
],
'email' => [
'rules' => ['required', 'email'],
'message' => 'Email is required',
],
'phone' => [
'rules' => ['required'],
'message' => 'Phone is required',
],
'inquiring_product' => [
'message' => 'Inquiring product is required',
],
'product_use' => [
'message' => 'Product use is required',
],
'quantity' => [
'message' => 'Quantity is required',
],
'qna' => [
'message' => 'Q&A is required',
],
]);
if ($kirby->request()->is('POST')) {
$form->emailAction([
'to' => 'admin@gmail.com',
'from' => 'admin@gmail.com',
]);
}
return compact('form');
};
I found the following while looking for a similar question in Kirby Forum.
If I insert the contents below, I don’t know where to put them.
$success = kirby()->email([
'from' => 'welcome@supercompany.com',
'to' => 'someone@gmail.com',
'subject' => 'Welcome!',
'body' => 'We will never reply',
])->isSent();
dump($success);
Help me!