Welcome to the LimeSurvey Community Forum

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

Conditional basic admin notifications

  • HorizonsMolBio
  • HorizonsMolBio's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago - 1 month 2 weeks ago #258183 by HorizonsMolBio
Conditional basic admin notifications - SOLVED was created by HorizonsMolBio
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.28.76
Own server or LimeSurvey hosting: own (no superadmin rights)
Survey theme/template: vanilla
==================
Dear all,

Is it possible to send different emails as basic admin notifications, depending on the answer to one or several certain questions of the survey?
If so, how can I do that?

Context: I'm using LimeSurvey for a public (i.e. link-based access) registration form for an event, and would like to automatically send the participants an email with further instructions that vary depending on their respective answers to the survey. As one of the survey questions asks for the participants email address, I can easily generate a "confirmation" email using an expression script as input to the reciever of the basic admin notifications. The struggle begins when trying to define conditions in the basic admin notification template, i.e. the content of that notification. I imagine sth. following the logic of "if answer x, send template a; else if answer y, send template b; else send template c".
Last edit: 1 month 2 weeks ago by HorizonsMolBio. Reason: Letting everyone see that the question was sufficiently answered

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258189 by tpartner
Replied by tpartner on topic Conditional basic admin notifications
Yes, place the email contents in hidden equation questions and then reference those in the notification email template.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: holch, HorizonsMolBio

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258190 by holch
Replied by holch on topic Conditional basic admin notifications
It is the same thing as within the survey, you can use expression script in the email template and customize the text of your template.

So there is just one template, you can't have template A, B, C. But as you can customize the template with expression manager/script, you can make the modifications within the template. e.g. if answer X, write this and that, if answer y write something else into the template.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: HorizonsMolBio

Please Log in to join the conversation.

  • HorizonsMolBio
  • HorizonsMolBio's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago - 1 month 2 days ago #258196 by HorizonsMolBio
Replied by HorizonsMolBio on topic Conditional basic admin notifications
Thank you very much, tpartner and holch! This works perfectly fine :)

I hope you don't mind if I put your answers into a step-by-step solution for future inexperienced users with the same problem (as I as a complete LimeSurvey-newbie had some initial troubles to understand what exactly you mean)?
1.) Create question of the type "equation", activate "always hide this question" in its "Display" settings
2.) Put text to be used in the notification into the field "Question" of the question
3.) Repeat steps 1-2 for every text-element that you want to use in your notification
4.) Reference the hidden question(s) in the notification email template using an expression script (i.e. question code in curly brackets). Here, you can also enter the conditions that define whether a certain text-element should be shown in the notification.
Example: {(if question1.NAOK == "Y", textelement.question)}, with 'question1' defining whether the text-element should be shown, 'textelement' being the text put into the "Question" field of the equation, and the suffix '.question' making sure that the HTML formatted text-element instead of the unformatted text is used in the notification.
 
Last edit: 1 month 2 days ago by HorizonsMolBio.
The following user(s) said Thank You: tpartner

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258197 by tpartner
Replied by tpartner on topic Conditional basic admin notifications
No problem, we like contributions fornthe community.

I'm not sure about the requirement for relevance on the equation questions.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: HorizonsMolBio

Please Log in to join the conversation.

  • HorizonsMolBio
  • HorizonsMolBio's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 days ago #258963 by HorizonsMolBio
Replied by HorizonsMolBio on topic Conditional basic admin notifications
Yes, thank you, your are right! They are not necessary if the conditions are applied in the basic admin notifications. I've edited my post above accordingly, now also containing a solution to keep the HTML-formatting of the equation question in the basic admin notification.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose