I have created a survey using SurveyJS and rather than store the results of my survey on the SurveyJS website I would like to email the results of anyone that takes the survey to my own email address.
I have never used JSON before so this is my first time. Any guidance would be helpful!
The HTML:
<div id="surveyContainer"></div>
<div id="surveyResult"></div>
JSON from SurveyJS:
<script>
Survey
.StylesManager
.applyTheme("default");
var json = {SURVEY DATA HIDDEN}
window.survey = new Survey.Model(json);
survey
.onComplete
.add(function (result) {
document
.querySelector('#surveyResult')
.textContent = "Result JSON:\n" + JSON.stringify(result.data, null, 3);
});
$("#surveyContainer").Survey({model: survey});
</script>
Currently the results are displayed in the div with the ID of surveyResult. How can I not show them and send them in an email using PHP instead?
Thanks!