Hi, can i change the form email from field? client dislikes

Permalink 3 users found helpful

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

View Replies:
Tony replied on at Permalink Reply
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.
stressdesign replied on at Permalink Reply
the from address seems to be in helpers/mail.php, 1ine 125.

$from = 'XXXXXXX@' . str_replace(array('http://', 'https://'), '', BASE_URL);

change XXXXXXX@ to the address you want site e-mails to come from
plschneide replied on at Permalink Reply
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"
cbenci replied on at Permalink Reply

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.
fig replied on at Permalink Reply
fig replied on at Permalink Reply

line 322

change from:
$mh->from( $formFormEmailAddress );

foreach ($_POST as $key => $value){
   if (strstr($value,'@')){
   } else {

This will use the email address in any form field as the from field on the notification email (looks for the @ sign).
plschneide replied on at Permalink Reply
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?
SigmaAlphaPi replied on at Permalink Reply
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.
fig replied on at Permalink Reply
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.

line 319

               $formFormEmailAddress = FORM_BLOCK_SENDER_EMAIL;  
               $formFormEmailAddress = $adminUserInfo->getUserEmail(); 

$formFormEmailAddress = $_POST['Question28'];

(Replace Question28 with your own email field name.)
mose replied on at Permalink Reply
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.
yashvit replied on at Permalink Reply
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.
Remo replied on at Permalink Reply
@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..
djes replied on at Permalink Reply
Small hack :
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 );
wendysandsheds replied on at Permalink Reply
This didn't work for me!

I assume you refering to concrete/blocks/form/controller.php ?
fig replied on at Permalink Reply
I use the extended form block now, saves messing around with hacks.
twomoons replied on at Permalink Reply
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?

jordanlev replied on at Permalink Reply
I would try posting this to the support forum for the Extended Form addon -- go here:
...and click "Support" in the sidebar.
helenmarie replied on at Permalink Reply
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?
plschneide replied on at Permalink Reply
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.
kesnav replied on at Permalink Reply
Hey everyone, this is how you can change the "from" email:

envisage replied on at Permalink Reply
I can't get this to work. I must be doing something wrong...any help is greatly appreciated.


                $answer=intval( $tmpFileIds[intval($row['msqID'])] );

            $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->setSubject(t('%s Form Submission', $this->surveyName));
            //echo $mh->body.'<br>';
kesnav replied on at Permalink Reply
Hi envisaje, try overriding the core files using concrete5 directory override structure. i.e. put the modified file in:

envisage replied on at Permalink Reply
THANK YOU! That did the trick. All is working now.