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,
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,
![Steevb](/files/avatars/9622.jpg)
Will this help:http://www.concrete5.org/documentation/how-tos/editors/set-site-ema...
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.
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.
This block of code from the form controller.php seems to be what is pertinent.
So it looks to me that it is not grabbing the FORM_BLOCK_SENDER_EMAIL value and defaulting to mine for some reason.
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));
Viewing 15 lines of 18 lines. View entire code block.
So it looks to me that it is not grabbing the FORM_BLOCK_SENDER_EMAIL value and defaulting to mine for some reason.
I have managed to force the form notification to behave but it's not the cleanest workaround.
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.
This is located at line 348 (or there abouts) in concrete/blocks/form/controller.php
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
I've added the constant but I still get concrete5-noreply@domain.org.
Wondering how I get rid of the concrete5 part.
Thanks.
Joel
Wondering how I get rid of the concrete5 part.
Thanks.
Joel
Got it - edit concrete / mail / block_form_submission.php
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
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
It still surprises me that this would not be a default