FORM_BLOCK_SENDER_EMAIL
Permalink
Hey all,
I'm trying to get the forms block to use the user's email in the From field, and I have read that using FORM_BLOCK_SENDER_EMAIL in /config/site.php should help with this.
I'm just lost as to how to actually enable it. Basically i have in my site.php, but this isn't working.
Any help would be appreciated, I know its probably something simple.
Cheers.
I'm trying to get the forms block to use the user's email in the From field, and I have read that using FORM_BLOCK_SENDER_EMAIL in /config/site.php should help with this.
I'm just lost as to how to actually enable it. Basically i have
define('FORM_BLOCK_SENDER_EMAIL ','');
Any help would be appreciated, I know its probably something simple.
Cheers.
Thanks for the reply.
I found it mentioned here:http://www.concrete5.org/community/forums/customizing_c5/forms_emai...
I was hoping to get the actual email of the person submitting the form as the from email. I could be totally wrong with my understanding of what this constant does also!
I found it mentioned here:http://www.concrete5.org/community/forums/customizing_c5/forms_emai...
I was hoping to get the actual email of the person submitting the form as the from email. I could be totally wrong with my understanding of what this constant does also!
i think is for the identity of the website, like the from the website email, not from the person who is sending that email.
so...
just create a dummy email called no-reply@youdomain.com
and put it in the constant
so...
just create a dummy email called no-reply@youdomain.com
and put it in the constant
Yeah that makes sense actually. I guess an external form would probably end up being easier for this kind of thing.
Thanks for the help.
Thanks for the help.
yes i have this problem too, the script go to second block, i just want to put email sender to this FORM_BLOCK_SENDER_EMAIL.
suck a pain..
this how i solve this problem open:
concrete/block/form/controller.php
i change
to
if that array not match, try print_r
and remember, this will seting all your from block, since i just use form for 'contact page'
suck a pain..
this how i solve this problem open:
concrete/block/form/controller.php
i change
$mh->from( $formFormEmailAddress );
to
$mh->from( $questionAnswerPairs[3]['answer'] );
if that array not match, try print_r
and remember, this will seting all your from block, since i just use form for 'contact page'
Hi Guys,
If you alter the core form block, it wont work when upgraded, so it would be better to duplicate the form block and do the necessary changes that you want to do.
Many thanks
Vijay
If you alter the core form block, it wont work when upgraded, so it would be better to duplicate the form block and do the necessary changes that you want to do.
Many thanks
Vijay
that's why i said
"and remember, this will seting all your from block, since i just use form for 'contact page'"
just move it
to /block/form
from /concrete/block/form
and why the FORM_BLOCK_SENDER_EMAIL must be the admin email, not the email that i put in block form options?
"and remember, this will seting all your from block, since i just use form for 'contact page'"
just move it
to /block/form
from /concrete/block/form
and why the FORM_BLOCK_SENDER_EMAIL must be the admin email, not the email that i put in block form options?
Here's my fix for that. Add this to the config/site.php and you can intercept all of your from emails:
# special code to intercept contact us pages and set the FROM adddress properly if (!empty($_POST)) { # default to admin $final_email = 'no-reply@<your site here.com>'; # if we have something in Question3 (my email is question3) if ($_POST['Question3']) { $test_email = preg_replace("/[\r\n]/", '', $_POST['Question3']); # check to see if it's a valid email address if (eregi("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $test_email)) { # we passed the syntax check, let's check the dns records $host = ereg_replace(".*@", "", $test_email) . "."; if (getmxrr($host, $mxhosts) != false || gethostbyname($host) != $host ) { $final_email = $test_email; } }
Viewing 15 lines of 19 lines. View entire code block.
define('FORM_BLOCK_SENDER_EMAIL ','youremail@here.com');
I am not familiar of this constant but I think you set it up like that, where did you find this constant mentioned?
Thanks