Hi, can i change the form email from field? client dislikes
Permalink 3 users found helpful
Hi,
I have a a couple of forms on my client's website for applying online for classes. It's set up so that she is emailed with each submission, she likes to be able to email people back and what she does is hit reply. This then ends up sending an email back to me, i get the reply instead of the person who submitted the form, it told her that she will have to copy the answer to the email question on the form and send her replies to that. But this is a little tedious and she sometimes forgets, sending me lots of replys. Any idea as to how i can set the form up so that on reply it sends back to the email address submitted? or at least change the from on the email to something other than my personal email address.
Thanks much
I have a a couple of forms on my client's website for applying online for classes. It's set up so that she is emailed with each submission, she likes to be able to email people back and what she does is hit reply. This then ends up sending an email back to me, i get the reply instead of the person who submitted the form, it told her that she will have to copy the answer to the email question on the form and send her replies to that. But this is a little tedious and she sometimes forgets, sending me lots of replys. Any idea as to how i can set the form up so that on reply it sends back to the email address submitted? or at least change the from on the email to something other than my personal email address.
Thanks much
at this point you'd have to override the current form block and hack at it to get the user's email in the reply field.
the from address seems to be in helpers/mail.php, 1ine 125.
change XXXXXXX@ to the address you want site e-mails to come from
$from = 'XXXXXXX@' . str_replace(array('http://', 'https://'), '', BASE_URL);
change XXXXXXX@ to the address you want site e-mails to come from
Any idea of how to grab a specific field from the form (e.g., email) that a user submitted and replaced that with the default field?
Course maybe this is not where to do it. I am thinking of the "notify person of email report and having that from changed to be basically the email field (whoever submitted it). As is, kinda annoying to not be able to "hit reply"
Course maybe this is not where to do it. I am thinking of the "notify person of email report and having that from changed to be basically the email field (whoever submitted it). As is, kinda annoying to not be able to "hit reply"
+1.
Being able to pick a field as the 'reply to' in the email form would make this form the best.
This can be a real deal breaker for most of my clients, most just want to click 'reply to' and start typing.
Being able to pick a field as the 'reply to' in the email form would make this form the best.
This can be a real deal breaker for most of my clients, most just want to click 'reply to' and start typing.
+1
/concrete/blocks/form/controller.php
line 322
change from:
to:
This will use the email address in any form field as the from field on the notification email (looks for the @ sign).
line 322
change from:
$mh->from( $formFormEmailAddress );
to:
foreach ($_POST as $key => $value){ if (strstr($value,'@')){ $mh->from($value); } else { $mh->from($this->formFormEmailAddress); } }
This will use the email address in any form field as the from field on the notification email (looks for the @ sign).
This looks like it would do the trick, but I added it in and it hasn't seemed to make a difference. I was thinking I might have put the file in the wrong folder, but I went ahead and just overwrote the one in the concrete folder when it didn't work, and that didn't seem to do the trick either.
Any suggestions?
Any suggestions?
Couldn't that just be put in a reply-to in the mail's header.
How or where could that be done?
I'm experiencing the same problems as many others do.
How or where could that be done?
I'm experiencing the same problems as many others do.
Well, that previous code doesn't seem to work all the time, so here's a hack that will work for a certain form field only.
/concrete/blocks/form/controller.php
line 319
replace:
with:
(Replace Question28 with your own email field name.)
/concrete/blocks/form/controller.php
line 319
replace:
with:
$formFormEmailAddress = $_POST['Question28'];
(Replace Question28 with your own email field name.)
I have submitted a patch to mail.php that allows it to handle a Reply-To address, just like a To or From address. The form block would still need to be updated to use it, but if the patch is accepted, the tool will be in the toolbox.
any news on the patch being approved??
i have tried hackin in some code in the controller to change the from address. it wont work for me as i'm using SMTP. php mail hasnt ever worked for me. something tells me its my webserver.
i have tried hackin in some code in the controller to change the from address. it wont work for me as i'm using SMTP. php mail hasnt ever worked for me. something tells me its my webserver.
@Mose, could you please post the patch as long as it hasn't been integrated into Concrete5?
Being able to set the reply-to address seems like an important thing..
Being able to set the reply-to address seems like an important thing..
Small hack :
Add an "Email" question in your form. Be sure to name it Email.
Add this at line 310
Change line 331 from to
Add an "Email" question in your form. Be sure to name it Email.
Add this at line 310
if ($row['question'] == 'Email') $formFormSenderEmail = $questionAnswerPairs[$row['msqID']]['answer'];
Change line 331 from
$mh->from( $formFormEmailAddress );
$mh->from( $formFormSenderEmail );
This didn't work for me!
I assume you refering to concrete/blocks/form/controller.php ?
I assume you refering to concrete/blocks/form/controller.php ?
I use the extended form block now, saves messing around with hacks.
http://www.concrete5.org/marketplace/addons/extended-form/...
http://www.concrete5.org/marketplace/addons/extended-form/...
Hi, We bought Extended Form but it doesn't seems to reply to the sender's email, it is still replying to the admin email.
How did you get it to work? Do you mind to share please?
Thanks!
How did you get it to work? Do you mind to share please?
Thanks!
I would try posting this to the support forum for the Extended Form addon -- go here:
http://www.concrete5.org/marketplace/addons/extended-form/...
...and click "Support" in the sidebar.
http://www.concrete5.org/marketplace/addons/extended-form/...
...and click "Support" in the sidebar.
Has anyone actually managed to get this working on the standard form? All the posts above seem to say that the hacks dont work? and theres no point buying the extended version if that does not set the reply to field either?
FYI I've used the extended form for a few different sites. It DOES allow you to specify a from address. I actually forgot to turn that on and people were replying to form data to me - didn't want that, so I went in and was able to specify the from as being from another address.
Hey everyone, this is how you can change the "from" email:
http://www.concrete5.org/documentation/how-tos/developers/add-abili...
http://www.concrete5.org/documentation/how-tos/developers/add-abili...
I can't get this to work. I must be doing something wrong...any help is greatly appreciated.
updates/concrete 5.5.2.1/concrete/blocks/form/controller.php
updates/concrete 5.5.2.1/concrete/blocks/form/controller.php
} }elseif($row['inputType']=='text'){ $answerLong=$txt->sanitize($_POST['Question'.$row['msqID']]); $answer=''; }elseif($row['inputType']=='fileupload'){ $answer=intval( $tmpFileIds[intval($row['msqID'])] ); }elseif($row['inputType']=='url'){ $answerLong=""; $answer=$txt->sanitize($_POST['Question'.$row['msqID']]); }elseif($row['inputType']=='email'){ $answerLong=""; $answer=$txt->sanitize($_POST['Question'.$row['msqID']]); $fromEmail=$answer; }elseif($row['inputType']=='telephone'){ $answerLong="";
Viewing 15 lines of 20 lines. View entire code block.
} $mh = Loader::helper('mail'); $mh->to( $this->recipientEmail ); $mh->from( $fromEmail ); $mh->addParameter('formName', $this->surveyName); $mh->addParameter('questionSetId', $this->questionSetId); $mh->addParameter('questionAnswerPairs', $questionAnswerPairs); $mh->load('block_form_submission'); $mh->setSubject(t('%s Form Submission', $this->surveyName)); //echo $mh->body.'<br>'; @$mh->sendMail(); }
Hi envisaje, try overriding the core files using concrete5 directory override structure. i.e. put the modified file in:
<site_root>/blocks/form/controller.php
<site_root>/blocks/form/controller.php
THANK YOU! That did the trick. All is working now.