0

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!

632E
  • 11
  • 2

1 Answers1

0

If you are asking about the sever side code then you need to check this thread - Using HTML and PHP to send form data to an email

If you are asking about the client side JavaScript - check these threads: How to send HTML form data by email to an email ID by using JavaScript, without using server-side language, without using email client securely? How to send an email from JavaScript

TSV
  • 7,538
  • 1
  • 29
  • 37