Here is my final solution for anyone else that has the same question or issue.
My two forms are a standard contact form and a more detailed Quick Quote form. I have set them up in the template file and called the form controller that has the following code in:
use Uniform\Form;
return function ($kirby)
{
$contactform = new Form([
'name' => [
'rules' => ['required'],
'message' => 'Please enter your name',
],
'email' => [
'rules' => ['required', 'email'],
'message' => 'Please enter a valid email address',
],
'company' => [],
'tel' => [],
'message' => [
'rules' => ['required'],
'message' => 'Please enter a message',
],
],'contact-form');
$quickquoteform = new Form([
'qqname' => [
'rules' => ['required'],
'message' => 'Please enter your name',
],
'qqemail' => [
'rules' => ['required', 'email'],
'message' => 'Please enter a valid email address',
],
'qqcompany' => [],
'qqtel' => [],
'qqmessage' => [
'rules' => ['required'],
'message' => 'Please enter a message',
],
],'quickquote-form');
if ($kirby->request()->is('POST')) {
if (get('formid') === 'contact') {
$contactform->emailAction([
'to' => 'name@email.co.uk',
'from' => 'no-reply@email.co.uk',
'subject' => 'Contact form submission from website.com'
]);
} elseif (get('formid') === 'quickquote') {
$quickquoteform->emailAction([
'to' => 'name@email.co.uk',
'from' => 'no-reply@email.co.uk',
'subject' => 'Contact form submission from website.com'
]);
}
}
return compact('contactform','quickquoteform');
};
The final section that determines which form to submit uses a hidden field in each form (as per this thread):
<input type="hidden" name="formid" value="contact [OR] quickquote">
Many thanks to @texnixe for her help and to @mzur for making the plugin.
I’m still learning but getting there with your awesome support.