Help with my first customization
Permalink
Hello -
I'm starting off really small scale with my first customization. I've built a 'Contact Us' page and used a Form block to do so. This works great and properly emails us etc..., however I'd like to change the 'From/reply to' email address from that of the site to the email the address the user submits in one of the form fields. I think this is a basic enough mod to cut my teeth on with C5.
Looking at the /concrete/blocks/form/controller.php on line 333 there is the $mh->from( $formFormEmailAddress ); which is what I'll probably want to change. However I'm a bit unsure of 2 things.
1) What do I need to do to customize this block (do I need to copy everything from /concrete/blocks/form/ to /blocks/form/ or just the controller.php)?.
2) How do I go about getting the value from one of the form fields to populate in the $mh->from variable.
Thanks in advance, I hope I'm heading in the right direction (if not please let me know Im very new to C5).
I'm starting off really small scale with my first customization. I've built a 'Contact Us' page and used a Form block to do so. This works great and properly emails us etc..., however I'd like to change the 'From/reply to' email address from that of the site to the email the address the user submits in one of the form fields. I think this is a basic enough mod to cut my teeth on with C5.
Looking at the /concrete/blocks/form/controller.php on line 333 there is the $mh->from( $formFormEmailAddress ); which is what I'll probably want to change. However I'm a bit unsure of 2 things.
1) What do I need to do to customize this block (do I need to copy everything from /concrete/blocks/form/ to /blocks/form/ or just the controller.php)?.
2) How do I go about getting the value from one of the form fields to populate in the $mh->from variable.
Thanks in advance, I hope I'm heading in the right direction (if not please let me know Im very new to C5).
2) This is kind of tricky, because the questions and answers are identified by id numbers, but the id numbers are going to be different for each form block (and if the block is edited the question/answer id's might change on you). So you're probably going to want to do some kind of query against the database (where the questions and answers are stored) to retrieve the id of the question/answer that has the label of "Email Address" (or whatever you call it in the block). Look to some of the other code in that controller function to see some sample SQL, and look to the btFormQuestion and btFormAnswer tables in the database to see what the fields are called. If you can't figure it out, post back and I'm sure someone can help you more (I don't know the exact answer off the top of my head right now).
Good luck!
-Jordan