Welcome to the LimeSurvey Community Forum

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

Send conditional mail by multiple response

  • Sergi80
  • Sergi80's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 2 weeks ago - 4 months 1 week ago #265769 by Sergi80
I have been using limesurvey for a few months and I would like to know if it is possible to create a questionnaire with a multiple choice option as one of the questions, and depending on the checked boxes, send an email to those specific accounts. I have followed these steps but they do not work

[url] forums.limesurvey.org/forum/can-i-do-thi...a-question-condition [/url]


Your LimeSurvey version: LimeSurvey Community Edition   Version 6.5.15+240701
Own server
Last edit: 4 months 1 week ago by c_schmitz.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 1 week ago #265789 by Joffm
Replied by Joffm on topic Send conditional mail by multiple response
Hi,
As I understand the subquestion text are the email addresses.

Now I'd use the "list()" function to get a comma separated list of the selected addresses  (remember to use ".shown")
To switch to a colon separated list you may use the function "str_replace".
It's smething like this
{str_replace(',',';',list(that.Q1.shown))}
This you do preferable in a question of type equation and pipe this into the address field of the notification.
But you also can enter the function directly.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Sergi80
  • Sergi80's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #265802 by Sergi80
Replied by Sergi80 on topic Send conditional mail by multiple response
Hi,

can we do the complete example? Please find attached the "question" with the answer options. In the example I saw to send the email to the admin such that:

{if (ContactOptions_SQ001=="Y", "destiny@mail.com","" } (attached screenshot)

but the email must go to 1 or n people depending on the chosen selection, what is the easiest way to do it?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 1 week ago #265805 by Joffm
Replied by Joffm on topic Send conditional mail by multiple response
Hi,
so the subquestion text is not the email address.
This is the lack if you do not send the lss export. We do not know exactly, what you really want to do.

In your case you can do a "join" of the addresses depending on the selection, or a "list()" and exchange the comma to colon,
like

{join(if(Q1_SQ001=="Y","email1@example.com;",""),if(Q1_SQ002=="Y","email2@example.com;",""),if(Q1_SQ003=="Y","email3@example.com;",""),...)}

{str_replace(',',':',list(if(Q1_SQ001=="Y","email1@example.com",""),if(Q1_SQ002=="Y","email2@example.com",""),if(Q1_SQ003=="Y","email3@example.com",""),...)}


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Sergi80
  • Sergi80's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #265810 by Sergi80
Replied by Sergi80 on topic Send conditional mail by multiple response
I want to send the survey result to the person of the respondent's choice.

In which section should I place the options you indicate?

{join(if(Q1_SQ001=="Y","email1@example.com;",""),if(Q1_SQ002=="Y","email2@example.com;",""),if(Q1_SQ003=="Y","email3@example.com;",""),...)}

{str_replace(',',':',list(if(Q1_SQ001=="Y","email1@example.com",""),if(Q1_SQ002=="Y","email2@example.com",""),if(Q1_SQ003=="Y","email3@example.com",""),...)}

Thanks Joffm

Please Log in to join the conversation.

  • Sergi80
  • Sergi80's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #265812 by Sergi80
Replied by Sergi80 on topic Send conditional mail by multiple response
OK,

now send mail, the rest will be to confirm the conditions

Thanks Joffm

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
4 months 1 week ago #265816 by DenisChenu
Replied by DenisChenu on topic Send conditional mail by multiple response
When i need complex email construction : i always use an equation question type or a text display question (with QCODE.question usage).

Really more easy to construct.

For informltion email listlike this : ,,,user@example.org,,,,user2@example.com,,, must work :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
1 week 6 days ago #267789 by ingoauhagen
Replied by ingoauhagen on topic Send conditional mail by multiple response
Hi,
i want to setup a similar notification mail function. Did you find a solution for your problem?
Best,
Ingo

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
1 week 6 days ago #267812 by DenisChenu
Replied by DenisChenu on topic Send conditional mail by multiple response

Hi,
i want to setup a similar notification mail function. Did you find a solution for your problem?
Best,
Ingo
 
Best is always explain your EXACT issue and create a topic.
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: holch

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose