- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
send email based on answers
- srn122
- Topic Author
- Offline
- New Member
Less
More
3 years 11 months ago #199828
by srn122
send email based on answers was created by srn122
Hello,
I am using Version 3.6.1+180329.
I have a short survey with 4 yes/no questions and an email field.
Is it possbile to send an email to the email address completed by user?
There will be two scenarios:
-in case of all yes answers send an email
-if one or more no answers send a different email.
Thank you
I am using Version 3.6.1+180329.
I have a short survey with 4 yes/no questions and an email field.
Is it possbile to send an email to the email address completed by user?
There will be two scenarios:
-in case of all yes answers send an email
-if one or more no answers send a different email.
Thank you
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
3 years 11 months ago #199829
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic send email based on answers
Use one of the notification emails.
let's say "Send basic admin notification email to:"
In the email field enter {Q_email} with "Q_email" as code of your email question.
In the email body you use "micro-tayloring" to enter the texts.
E.g.
{if(Q1=="Y" AND Q2=="Y" AND Q3=="Y" AND Q4=="Y","Text of 4 YES answers","Text of 1 or more NO answers")}
Joffm
let's say "Send basic admin notification email to:"
In the email field enter {Q_email} with "Q_email" as code of your email question.
In the email body you use "micro-tayloring" to enter the texts.
E.g.
{if(Q1=="Y" AND Q2=="Y" AND Q3=="Y" AND Q4=="Y","Text of 4 YES answers","Text of 1 or more NO answers")}
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, cdorin, srn122
The topic has been locked.
- srn122
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
3 years 11 months ago #199871
by srn122
Replied by srn122 on topic send email based on answers
Thank you for your reply,
I have managed to do something but I only receive empty emails.
I tried different ways but same results.
i used question codes(Q1, Q2..), question codes with curly brackets({Q1}, {Q2}..) with answer codes with or without curly brackets(Q1A1, {Q2A1}...) or exact string as you mentioned Q1=="Nu" but always empty emails.
And I dont see what I am doing wrong.
Are there some explanations as to what type of coding I should enter to make it work?
I ve tried looking at this manual section but it didnt help me: manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming
Thank you
I have managed to do something but I only receive empty emails.
I tried different ways but same results.
i used question codes(Q1, Q2..), question codes with curly brackets({Q1}, {Q2}..) with answer codes with or without curly brackets(Q1A1, {Q2A1}...) or exact string as you mentioned Q1=="Nu" but always empty emails.
And I dont see what I am doing wrong.
Are there some explanations as to what type of coding I should enter to make it work?
I ve tried looking at this manual section but it didnt help me: manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming
Thank you
The topic has been locked.
- cdorin
- Offline
- Elite Member
Less
More
- Posts: 234
- Thank you received: 40
3 years 11 months ago #199872
by cdorin
Manual: manual.limesurvey.org/LimeSurvey_Manual
Bugs tracker: bugs.limesurvey.org/my_view_page.php
If you self-host and need help, contact one of our partners: limesurvey.com
Please do not contact me via PM - thank you.
Replied by cdorin on topic send email based on answers
Better provide an .lss file to see what you did so far
Manual: manual.limesurvey.org/LimeSurvey_Manual
Bugs tracker: bugs.limesurvey.org/my_view_page.php
If you self-host and need help, contact one of our partners: limesurvey.com
Please do not contact me via PM - thank you.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
3 years 11 months ago #199884
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic send email based on answers
Hi,
see here:
manual.limesurvey.org/ExpressionScript_H..._in_invitation_email
and
manual.limesurvey.org/ExpressionScript_-...#Access_to_variables
{if(Q1=="Y" AND Q2=="Y" AND Q3=="Y" AND Q4=="Y","Text of 4 YES answers","Text of 1 or more NO answers")}
To find out how these predefined question types (Y/N, Gender, array(Yes/No/Unsure),..) are coded, you should activate a small sample survey with these question types, enter some data, and look at the answer table.
But nevertheless: as cdorin: Send your lss export.
Joffm
see here:
manual.limesurvey.org/ExpressionScript_H..._in_invitation_email
and
manual.limesurvey.org/ExpressionScript_-...#Access_to_variables
Nowhere I mentioned this.exact string as you mentioned Q1=="Nu"
{if(Q1=="Y" AND Q2=="Y" AND Q3=="Y" AND Q4=="Y","Text of 4 YES answers","Text of 1 or more NO answers")}
To find out how these predefined question types (Y/N, Gender, array(Yes/No/Unsure),..) are coded, you should activate a small sample survey with these question types, enter some data, and look at the answer table.
But nevertheless: as cdorin: Send your lss export.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- srn122
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
3 years 10 months ago #199907
by srn122
Replied by srn122 on topic send email based on answers
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
3 years 10 months ago - 3 years 10 months ago #199908
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic send email based on answers
2. mistakes
1. The syntax of this IF-statement is wrong_
{if({Q3}=="Nu" AND {Q4}=="Nu" AND {Q5}=="Nu" AND {Q6}=="Nu","No Answer text","Yes Answer text")}
Can't you copy what I wrote?
2. You have to compare with CODE of answer option, NOT text of answer option
In your first post you talked about "Yes/No" question.
Therefore this statement compares with the code of a "Yes/No" question.
But now I see that you use a list radio. So you have to use these codes.
So obviously you have to use:
{if(Q1=="A1" AND Q2=="A1" AND Q3=="A1" AND Q4=="A1","Text of 4 YES answers","Text of 1 or more NO answers")}
Joffm
1. The syntax of this IF-statement is wrong_
{if({Q3}=="Nu" AND {Q4}=="Nu" AND {Q5}=="Nu" AND {Q6}=="Nu","No Answer text","Yes Answer text")}
Can't you copy what I wrote?
2. You have to compare with CODE of answer option, NOT text of answer option
In your first post you talked about "Yes/No" question.
Therefore this statement compares with the code of a "Yes/No" question.
{if(Q1=="Y" AND Q2=="Y" AND Q3=="Y" AND Q4=="Y","Text of 4 YES answers","Text of 1 or more NO answers")}
But now I see that you use a list radio. So you have to use these codes.
So obviously you have to use:
{if(Q1=="A1" AND Q2=="A1" AND Q3=="A1" AND Q4=="A1","Text of 4 YES answers","Text of 1 or more NO answers")}
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 10 months ago by Joffm.
The topic has been locked.
- srn122
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
3 years 10 months ago #199946
by srn122
Replied by srn122 on topic send email based on answers
I ve said I tried all possible combination, including your expression, the one you saw was probably just the last attempt.
Anyway, now it works, thank you.
But I have another issue: Can I add text with html tags inside the email body?
The second email won't be just a phrase.
Now I have something like this on the 'source' tab, and in place of formatted text I receive only blank email:
<html>
<head>
<title></title>
</head>
<body>{if(Q3=="A1" AND Q4=="A1" AND Q5=="A1" AND Q6=="A1","TEXTTEXTTEXT","TEXTTEXTTEXTT
<ul>
<li>OPTION1OPTION1.</li>
<li>OPTION2OPTION2</li>
<li>OPTION3OPTION3.</li>
</ul>
")}</body>
</html>
Anyway, now it works, thank you.
But I have another issue: Can I add text with html tags inside the email body?
The second email won't be just a phrase.
Now I have something like this on the 'source' tab, and in place of formatted text I receive only blank email:
<html>
<head>
<title></title>
</head>
<body>{if(Q3=="A1" AND Q4=="A1" AND Q5=="A1" AND Q6=="A1","TEXTTEXTTEXT","TEXTTEXTTEXTT
<ul>
<li>OPTION1OPTION1.</li>
<li>OPTION2OPTION2</li>
<li>OPTION3OPTION3.</li>
</ul>
")}</body>
</html>
The topic has been locked.
- holch
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11653
- Thank you received: 2740
3 years 10 months ago #200019
by holch
Yes.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic send email based on answers
Can I add text with html tags inside the email body?
Yes.
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: DenisChenu
The topic has been locked.
- srn122
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
3 years 10 months ago #200025
by srn122
Replied by srn122 on topic send email based on answers
I meant inside the text of the two different emails messages.
As I tried with the unordered list, but it doesnt show.
As I said when I try it only sends blank emails.
I hope I explained it well
As I tried with the unordered list, but it doesnt show.
As I said when I try it only sends blank emails.
I hope I explained it well
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
3 years 10 months ago #200031
by DenisChenu
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 .
I don't answer to private message.
Replied by DenisChenu on topic send email based on answers
Mail was set as html ?
Can you reproduce on a sample light lss ?
If yes : report issue
Can you reproduce on a sample light lss ?
If yes : report issue
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 .
I don't answer to private message.
The topic has been locked.
- srn122
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
3 years 10 months ago #200038
by srn122
I think it is by default. Where is this option?
I uploaded an lss earlier.
Or do you mean something else?
Replied by srn122 on topic send email based on answers
DenisChenu wrote: Mail was set as html ?
I think it is by default. Where is this option?
Can you reproduce on a sample light lss ?
I uploaded an lss earlier.
Or do you mean something else?
If yes : report issue
The topic has been locked.