Welcome to the LimeSurvey Community Forum

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

Send response to mail address after complete?

  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 6 months ago #141978 by pmonstad
I'm not sure if this is possible and how it can be done. I ask here and hope for an answer.

I have made a short survey, more correct a form, without tokens (tokens are not an option here). This form should be sent to one or more mails when form is submitted. The possible mail addresses (names) are selected from a question (multiple choice). In this list human names are visible and chosen. User choose which ones who have to receive the response.

I don't know how it is possible to link the name with a mail address (hidden question somewhere?) and then send to the receivers.

I hope you understand what I want to do. Is it possible?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 6 months ago #141982 by tpartner
Replied by tpartner on topic Send response to mail address after complete?
Try placing Expression Manager IF statement(s) in the Admin Notification setting.

Something like this (untested):

Code:
{if(Q1_SQ001 == 'Y', 'example@example.com', '')}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 6 months ago #141997 by pmonstad
Replied by pmonstad on topic Send response to mail address after complete?
But this will only check if an answer is Yes (Q1_SQ001) and then send notification to example@example.com? I need to send mail to a value found in a hidden question (I think). I have a dropdown menu (or even better a multiple choice question) where the values are found.

Select a name, and then pick a mail address and feed into Admin Notification setting. Could that be done?
The topic has been locked.
More
7 years 6 months ago #142001 by jelo

pmonstad wrote: I need to send mail to a value found in a hidden question (I think). I have a dropdown menu (or even better a multiple choice question) where the values are found.

Tpartner showed you an example. Nobody except you knows what your current survey looks like.
A dropdown menu in LimeSurvey would mean single choice.
When using a multiple-choice question you will need to handle the situation, that more than one email-address has to be placed into the email field. Can be easy, can be tricky. If a single email-address can be send with a trailing semicolon it will be easy.
Since more than one email-address are separated via semicolon (;) - eg "yourname@test.com; myname@test.com;hisname@test.com" you then can put them all together:
{if(Q1_SQ001 == 'Y', 'example@example.com;', '')}{if(Q1_SQ002 == 'Y', 'example2@example.com;', '')}{if(Q1_SQ003 == 'Y', 'example@example.com;', '')}etc.
Still need some testing and tweaking.
Feel free to attach the survey here. And tell us what version/build of LimeSurvey you use. There might be bugs or issued which are version/build specific.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 6 months ago #142004 by pmonstad
Replied by pmonstad on topic Send response to mail address after complete?
Thanks! I will test this and let you know. I am running very latest 2.5.x.
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 6 months ago #142005 by pmonstad
Replied by pmonstad on topic Send response to mail address after complete?
Just one thing: I am fully aware there are possible many answers to my query, but is it possible to pick the mail addresses from a hidden question? The problem is it is tricky to maintain this when adding/editing/removing mail addresses as I have to edit the if statements in the settings. If possible it is a lot easier to maintain if I can edit a question. If there is a way to compare answer from Q1 with a matrix Q2 (one column with possible names and second column with mail address) and put result in the Admin Notify field it would probably solve this.
The topic has been locked.
More
7 years 6 months ago #142009 by jelo

pmonstad wrote: If there is a way to compare answer from Q1 with a matrix Q2 (one column with possible names and second column with mail address) and put result in the Admin Notify field it would probably solve this.

I don't know why you need a matrix question. If you use a hidden question you can choose another multiple-choice with email-addresses as answers.
You can use the default answers to tick the items in the hidden question when they are ticked in the displayed multiple-choice question.
You even can create the string via a equation question and put the result into the admin field.
The more complex your approach is the more issues might arise. Good luck.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 6 months ago #142070 by pmonstad
Replied by pmonstad on topic Send response to mail address after complete?
Perhaps I can solve this in a different way. Now I have made a question q1 (a drop down menu with answers like):

Paul: paul@example.com
Mary: Mary@example.com
John: john@example.com

Now I want to extract the mail address from the selected answer and insert this into the Admin notify settings. I hope this was a bit more spesific than my first question. I guess there have to be some javascript code here, and perhaps a hidden question to put the value into? Anyone who see any solution? I am not a programmer so I really need help here...
The topic has been locked.
More
7 years 6 months ago #142076 by jelo

pmonstad wrote: Anyone who see any solution?

It's getting more complicated for coders

Tpartner showed a simple way to do it.
You prefer having the email selection done in a question, instead of the settings.
To do this, you can use the Tpartner approach and put it into a equation question.
You hide the equation question.
You then put the questioncode of the equation question in the email field in the settings.

Feel free to attach a survey when you got stuck somewhere.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose