Using form submission email instead of admin's

Permalink
Is there a way to get a form forwarder to use the person that submitted the form's email address instead of the admin's email.
This is so that when a client receives a notification and hits reply I, the admin, don't get their reply, have to phone them and explain that they can't just hit reply but have to dig the email address out of the message body and reply to that.
Hopefully this makes sense.
Thank you kindly,

scorpa54
 
Steevb replied on at Permalink Reply
Steevb
scorpa54 replied on at Permalink Reply
scorpa54
Sorry not what I'm looking for.
As things are if someone fills out a contact form and sends it it goes to the reports page and also notifies the client that the form has had a submission. If the client hits reply to this notification, as would be normal for an email, then their response goes to the admin, me in this case, not to who submitted the form. This leaves me with the task of informing the client that I'm receiving their replies and what they need to do to correct this. Not as straight forward as a custom form.
Perhaps that is a clearer explanation of my problem.
Thank you for the response.
Steevb replied on at Permalink Reply
Steevb
scorpa54 replied on at Permalink Reply
scorpa54
This block of code from the form controller.php seems to be what is pertinent.

if(intval($this->notifyMeOnSubmission)>0 && !$foundSpam){   
            if( strlen(FORM_BLOCK_SENDER_EMAIL)>1 && strstr(FORM_BLOCK_SENDER_EMAIL,'@') ){
               $formFormEmailAddress = FORM_BLOCK_SENDER_EMAIL;  
            }else{ 
               $adminUserInfo=UserInfo::getByID(USER_SUPER_ID);
               $formFormEmailAddress = $adminUserInfo->getUserEmail(); 
            }  
            $mh = Loader::helper('mail');
            $mh->to( $this->recipientEmail ); 
            $mh->from( $formFormEmailAddress ); 
            $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));

So it looks to me that it is not grabbing the FORM_BLOCK_SENDER_EMAIL value and defaulting to mine for some reason.
scorpa54 replied on at Permalink Reply
scorpa54
I have managed to force the form notification to behave but it's not the cleanest workaround.
if(intval($this->notifyMeOnSubmission)>0 && !$foundSpam){
   // force senders email on forwarder
   $q="select answer from btFormAnswers where asID = '$answerSetID' && msqID = 2"; // this only works if the email question is in #2 position
   $mailfrom = mysql_query($q);
   $row = mysql_fetch_array($mailfrom);
   if( strlen($row['answer'])>1 && strstr($row['answer'],'@') ){
      $formFormEmailAddress = $row['answer'];  
   }else{ 
      $adminUserInfo=UserInfo::getByID(USER_SUPER_ID);
      $formFormEmailAddress = $adminUserInfo->getUserEmail(); 
   }

It would be nice if someone had a better fix than having to place the email question as the second entity on the form.

Edit:
Found a cleaner way to deal with this. A few lines up from this code is the "gathering" code and you only need to put in one line of code to make things work no matter the position of the email question on the form.
}elseif($row['inputType']=='email'){
   $answerLong="";
   $answer=$txt->sanitize($_POST['Question'.$row['msqID']]);
   define('FORM_BLOCK_SENDER_EMAIL', $answer); // add this line


This is located at line 348 (or there abouts) in concrete/blocks/form/controller.php
jkincaid replied on at Permalink Reply
I've added the constant but I still get concrete5-noreply@domain.org.

Wondering how I get rid of the concrete5 part.

Thanks.

Joel
jkincaid replied on at Permalink Reply
Got it - edit concrete / mail / block_form_submission.php
mkly replied on at Permalink Reply 1 Attachment
mkly
Hello,
To anyone reading this thread...

Newer versions of concrete5 allow you to select the reply to as one of the email fields. When you add or edit and email field, check the box that reads "Reply to this email address"

Attached is a screenshot.

Best Wishes,
Mike
scorpa54 replied on at Permalink Reply
scorpa54
It still surprises me that this would not be a default