Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Send additional email on submit

  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #134347 by dweisser
Send additional email on submit was created by dweisser
I would like to send additional emails on submit. I have sendmail.php which works in other contexts. Does anyone have a thought on why it's not firing on the survey submit?
Code:
$(document).ready(function(){    
 $('#movesubmitbtn').click(function(){     
 SendEmail();    
 });
});
Code:
function SendEmail() {
    var email = 'myemail@gmail.com';
   $.ajax({
      url:'http://www.domainname.com/surveyassets/sendmail.php?email_tocheck=' + email,
      complete: function (response) {
          $('#output').html(response.responseText);
      },
      error: function () {
          $('#output').html('Bummer: there was an error!');
      }
  });
  return false;
}
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #134353 by dweisser
Replied by dweisser on topic Send additional email on submit
Blaach.....i had a problem in my php!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #134359 by DenisChenu
Replied by DenisChenu on topic Send additional email on submit
Hi,

Why not use afterSurveySubmitted ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #134362 by dweisser
Replied by dweisser on topic Send additional email on submit
I'm not familiar with that. Does it accept expression manager variables like can I get expression questions into the emails? One problem with using the method above is that it's more difficult to get the questions and answers than it is using expression manager.
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #134364 by dweisser
Replied by dweisser on topic Send additional email on submit
Can I send multiple detailed notification emails using EM variables in General Settings>?

For example, something like this?
If Q1 ==A3, send two emails. If not A3, send no emails.

This isn't working.
{if(Q1.NAOK=='A3','email1@gmail.com; email2@gmail.com','')}

Any thoughts?
The topic has been locked.
More
7 years 11 months ago #134369 by first
Replied by first on topic Send additional email on submit
Working for me on Version 2.06+ Build 150612.

Check if your Q1.NAOK=='A3 is True by printing on next page.

Survey Designer and Programmer
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #134370 by dweisser
Replied by dweisser on topic Send additional email on submit
It is true.
The email does send conditionally if only one email is included., as in:

{if(Q1.NAOK=='A3','email1@gmail.com','')}

For some reason the inclusion of the second email causes neither to be sent. Two emails work fine (separated by a semi-colon and a space) when there is Expression Manager logic applied.

I've tried single quotes, double quotes, no quotes, comma an semi-colons. No joy.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose