Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Conditional email notification

Conditional email notification 11 months 3 weeks ago #109674

  • jboogie21
  • jboogie21's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 3
  • Karma: 0
Am I misunderstanding the instructions located here: manual.limesurvey.org/Survey_settings#No..._.26_data_management -
"As of Version 1.92: Enter a valid expression conforming to Expression Manager syntax. This lets you use question code instead of SGQA syntax (for easier readability), plus conditional logic (e.g. route the notifications to different people depending upon the data entered into the survey)."

The way I read this is that I can use Expression Manager syntax to create an email notification based on a user response. Is this not the case? I spent all day today and couldn't make it work...blerg

My particular use case is that I have LS scoring user responses (and it is working the way I want it to!). If a user scores over a certain threshold, I would like a basic notification sent to a staffer to review that users responses.

Can someone please provide some guidance, or tell me I'm missing something...
The administrator has disabled public write access.

Conditional email notification 4 months 2 weeks ago #116033

  • jboogie21
  • jboogie21's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 3
  • Karma: 0
I finally figured this out with the help from this post

My use case is a little different, but same principles:
  • create hidden equation questions that calculate the scores I want
  • create hidden equation that is condition I want to email on
  • my line of code in this case is:
    {if(RDAStotal.value le 47, 'whateveremailaddress', '')}
  • put {questioncode} from the email conditional equation I just created above in the Send basic admin email notification in the settings
  • format basic admin notification email template the way I want (in my case I put the the {questioncode} from the actual calculated score so I know what the actual score is when I get notified.
Last Edit: 4 months 2 weeks ago by jboogie21. Reason: fix hyperlink
The administrator has disabled public write access.
The following user(s) said Thank You: polux89

Conditional email notification 4 months 2 weeks ago #116087

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5623
  • Thank you received: 324
  • Karma: 255
Thanks for sharing your solution. Please extend the information at our manual (it's a wiki, everyone can and should edit it) if you are missing something there.
It also never hurts to have simple examples at the documentation.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118690

  • polux89
  • polux89's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi!

Thanks for your sharing.

The hidden equations questions works perfectly in my case. But I'm stuck with the configuration of the fields "Send basic admin email notification".

When I put the {questioncode} in the field, I did'nt get any notifcation. To verify my equation I simply put the {questioncode} in the text of the notification and put my e-mail adress in the "send basic..." field, results : the "whateveremailaddress" appeard correctly in the text.

Do I need any additional configuration? Do I have really to put only {questioncode} like that :

limesurvey_conditionalnotification-2.gif



Or perhaps with a command or a suffix?


Hope someone has a Tipps for me ;)

Thanks.
Attachments:
Last Edit: 1 month 4 weeks ago by polux89.
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118693

  • jboogie21
  • jboogie21's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 3
  • Karma: 0
It should be {questioncode.shown}. This is so it will populate your notification field with what is shown in your hidden question.
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118697

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3459
  • Thank you received: 475
  • Karma: 151
No, you can't use shown here. Because shown would include basically the item of the question (e.g. "email") instead of the actual email that has been written into the field for the respondents email (which is where the email should be sent, I assume).
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118703

  • jboogie21
  • jboogie21's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 3
  • Karma: 0
Holch I don't quite understand your explanation, as qcode.shown is what I have and when testing it works as desired.

In my case I have a hidden question with a line of code that would display an email address if the condition is met, blank field if not. Then in the notification setting it's that qcode.shown, so if the email is displayed an email is sent if not then no email.

I'm using the notification for admins (thus a static email), not a random user. Might that be what you're suggesting (i.e. wouldn't work for user inputted email addresses?)
Last Edit: 1 month 4 weeks ago by jboogie21. Reason: typing too fast
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118704

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3459
  • Thank you received: 475
  • Karma: 151
For a text question questioncode.shown is probably the same as as questioncode.

But let's say your question is

Q1. Which of the following would you choose:
1 Item 1
2 Item 2
3 Item 3

Lets assume we choose Item 2 (answer code 2). {Q1.shown) would give us "Item 2", {Q1} would give us "2".
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118709

  • polux89
  • polux89's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Thank you both for your help.

Like jboogie21 I use it only for determined admin email. We have six local offices, and I want that the results go directly to the right office.

The respondant has a multiple choice question to select his office, and then my equation "calculates" the correspondant email.

Exemple:

CITY: Please select your office

A city A ---> This email address is being protected from spambots. You need JavaScript enabled to view it.
B city B ---> This email address is being protected from spambots. You need JavaScript enabled to view it.
....

Value of {questioncode} is then one single textvalue, for example 'This email address is being protected from spambots. You need JavaScript enabled to view it.'

I tried it also with {questioncode.shown} and I didn't get any notification. No idea why...

I found a solution, but it is not very "clean". Instead of making an hidden equation, I put direct the equation {if(CITY_A == 'Y', 'This email address is being protected from spambots. You need JavaScript enabled to view it.',(if... ))} in the "notification to" field and it works!!!

I really don't understand why with the hidden equation it isn't the case...

If I take a look at the results, the hidden equation works, and the "value" of the email address is right. It seems that limesurvey can't "call" the value when it's time to send the notification...

I'm happy that it works now, but I will prefer a cleaner solution (must give back the survey responsability to other people...).

I'm a bit lost...
Last Edit: 1 month 4 weeks ago by polux89.
The administrator has disabled public write access.

Conditional email notification 1 month 4 weeks ago #118712

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3459
  • Thank you received: 475
  • Karma: 151
I am not quite sure, but you might have to write the result of the equation actually into a text answer.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.229 seconds
Donation Image