View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
07451 | Feature requests | Survey editing | public | 2010-11-11 21:20 | 2021-11-15 08:54 |
Reporter | Assigned To | galads | |||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Summary | 07451: Email results of survey to selectable address / protect email addresses | ||||
Description | Thank you for making LimeSurvey available to the Internet community. I have a great appreciation for all of the effort that has gone into developing this application and as such I would like to contribute by proposing an idea and including a solution. I am trying to have the results of a survey emailed to the a person listed in one of the questions. I am using the INSERTANS:... tag in the "email response to" field. So far this works in accordance with the documentation at: Ideally I would like to just display the names or job role of the recipient and not their actual email address so as to protect it from automated email address harvesters. Here is a sample situation: A medical clinic with 20 doctors is conducting a survey. Each doctor wants to receive a copy of a completed survey from their patient. Although I could create 20 identical surveys at 20 different URL's, it would make more sense to just have one survey and have the respondent pick their doctor's name from a list. Another reason to only want one survey is that I still want the results to be gathered into a single database so that I can generate reports and statistics for the clinic where the 20 doctors work. | ||||
Additional Information | A possible solution: Adding flexibility to an email address field. One quick fix to this problem is to modify the index.php file. Although this fix will not result in the email address being hidden, it will add the ability to specify both a name and email address in the same field, and to disguise or encode the email address itself. By adding the following code, you get the following new functionality: 1) You can use "(at)", "(dot)" and insert spaces anywhere you want in the email address. For example: 2) You can specify an email address which is hex encoded. It's not a sophisticated encoding. For example, ideas@limesurvey.org would be 6964656173406c696d657375727665792e6f7267 (not case sensitive) 3) You can specify both a name and an email address by placing the email address between square brackets. For example: Great Ideas [ideas@limesurvey.org] NOTE: You can use any combination of the above three options. Of course the hex version of the address is only useful if you combine it with #3 above. For example: Great Ideas [6964656173406c696d657375727665792e6f7267] So, here is how to implement this solution: ==== File to be modified: index.php ==== STEP 1: Add the following function right above the "sendsubmitnotification" function: function extractemailaddress($address) // by Michael Milette (2010-10-27) // eliminate everything outside of and including square brackets, if applicable // Decode back to string if the email address is hex encoded // replace (at) with @, the (dot) with . and remove all spaces return $address; STEP 2: modify the "sendsubmitnotification" function by adding in $ert=extractemailaddress($ert); as follows: //Now check each of the email addresses that they are valid before creating/adding to the $emailresponseto array $ert=extractemailaddress($ert);
That's it. You could also add a tool somewhere on the webpage to help users encode email addresses. Here is a simple Javascript function I wrote to do the encoding: // Convert characters in a string of text to hexadecimal string return hex; Please feel free to contact me if you have any questions. Thanks again for all your time and effort. With best regards, Michael Milette | ||||
Tags | No tags attached. | ||||
Bug heat | 4 | ||||
Story point estimate | |||||
Users affected % | |||||
Sorry, seems that the curly brackets don't come through in the posts. Please contact me if you would like me to send you the complete version of the source code. |
|
Hello mjm4842, Thank you for suggesting a feature. However, it seems the feature has been implemented already in the latest versions. Please check on the latest versions and if the issue still exists, feel free to re-open the report. kind regards, |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |
2021-11-15 08:54 | galads | Note Added: 67305 | |
2021-11-15 08:54 | galads | Bug heat | 2 => 4 |
2021-11-15 08:54 | galads | Assigned To | => galads |
2021-11-15 08:54 | galads | Status | acknowledged => closed |
2021-11-15 08:54 | galads | Resolution | open => fixed |