Send additional email on submit

More
3 years 7 months ago #134347 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?
$(document).ready(function(){		
 $('#movesubmitbtn').click(function(){     
 SendEmail();    
 });
});
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;
}

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 years 7 months ago #134353 by dweisser
Blaach.....i had a problem in my php!

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134359 by DenisChenu
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 .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134362 by dweisser
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.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134364 by dweisser
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','This email address is being protected from spambots. You need JavaScript enabled to view it.; This email address is being protected from spambots. You need JavaScript enabled to view it.','')}

Any thoughts?

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134369 by first
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

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134370 by dweisser
It is true.
The email does send conditionally if only one email is included., as in:

{if(Q1.NAOK=='A3','This email address is being protected from spambots. You need JavaScript enabled to view it.','')}

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.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!