Page 1 of 1
[SOLVED] Add extra field to contact form, almost there, need a bit of help
Posted: Wed Feb 19, 2025 1:16 am
by supak111
Trying to add an extra field to OC3 contact forum.
Have everything put into a OCmod and everything almost works.
Can someone tell me how to add my 2 new fields: 'vehicle' and 'hearaboutus' to this line of code:
Code: Select all
$mail->setText($this->request->post['enquiry']);
How do I change to 'enquiry' to include all 3 : 'vehicle' 'hearaboutus' and 'enquiry'?
Thanks for reading everyone ツ
Re: Add extra field to contact form, almost there, need a bit of help
Posted: Wed Feb 19, 2025 1:26 am
by supak111
Actually never mind guys, chatgpt gave me an example and I was able to make it work
Code: Select all
$mail->setText(
"Enquiry: " . $this->request->post['enquiry'] . "\n" .
"Vehicle: " . $this->request->post['vehicle']
);
Re: Add extra field to contact form, almost there, need a bit of help
Posted: Wed Feb 19, 2025 8:44 am
by by mona
Glad you resolved it yourself and thank you for coming back with an answer. +1 for that
Please can you mark it with [SOLVED] in the title.
Re: Add extra field to contact form, almost there, need a bit of help
Posted: Wed Feb 19, 2025 9:32 am
by Cue4cheap
supak111 wrote: ↑Wed Feb 19, 2025 1:26 am
Actually never mind guys, chatgpt gave me an example and I was able to make it work
Code: Select all
$mail->setText(
"Enquiry: " . $this->request->post['enquiry'] . "\n" .
"Vehicle: " . $this->request->post['vehicle']
);
Yes but also might want to mention where those two posts come from to help others.
Mike
Re: [SOLVED] Add extra field to contact form, almost there, need a bit of help
Posted: Wed Feb 19, 2025 11:17 am
by supak111