Welcome to the LimeSurvey Community Forum

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

Mixing html tags with EM

More
11 years 9 months ago #115233 by user40591_d
Hi
I'm building a custom comfirmation mail with expression.
So I add a text when question 1 is true, another when question 1 is false.
I got this working for simple text, but when I paste a full mail with html tags, the mail never parses correctly.
Now I'm filling out my survey every time to see my error. This is very tedious and time consuming.

I have all my quotes closed, all my html tags are filled correctly. I'm doing this all in the HTML editor. I suspect the wysiwyg editor messes everything up.

So I have 2 questions.
1. what is the best way to develop this?
2. is there a way to save the mail as I intended this. Is there a workaround?
The topic has been locked.
More
11 years 9 months ago #115238 by tpartner
Replied by tpartner on topic Mixing html tags with EM
I don't think you can use the editor - it will convert all of the tags when saving. Try disabling it.

Also, have a look at this post about embedding HTML tags in expressions - www.limesurvey.org/en/forum/design-issue...eak-in-string#114984


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
11 years 9 months ago - 11 years 9 months ago #115246 by DenisChenu
Replied by DenisChenu on topic Mixing html tags with EM
Hi,

ANd EM don't like line break in string :
Code:
{if(1,'something<br />
Another thing','')}
is broken

But without XSS (and HTML editor set to popup) I already used this:
Code:
{if(1,'<span class="error">','')}A string{if(1,'</span>','')}

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.
Last edit: 11 years 9 months ago by DenisChenu.
The topic has been locked.
More
11 years 9 months ago #115247 by user40591_d
Would it help to insert the template directly in the database without opening the template editor in the tool?
The topic has been locked.
More
11 years 9 months ago #115250 by DenisChenu
Replied by DenisChenu on topic Mixing html tags with EM

jelle wrote: Would it help to insert the template directly in the database without opening the template editor in the tool?

More this : www.limesurvey.org/manual/First_login_-_...er_preferences#Popup

In the template or the question text ?
The template are files, template editor work good for EM.

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 topic has been locked.
More
11 years 9 months ago #115428 by user43354_d
Hello,

I'm having the same trouble as Jelle. I need set the content of the confirmation mail depending on a question answerd by the taker of the survey. In the content of the mail I use HTML and CSS to format the layout of the email body.

Code bellow helps me to set the content of the mail depending on the answer for a question:
{if(Q01 == "Y" OR Q02 == "Y", "Content of the mail body","")}

Code bellow i have added the HTML and CSS and this doesn't work:
{if(Q01 == "Y" OR Q02 == "Y","<p style="font-weight: bold">Example content for the body</p><p>Second part of the content for the body</p>","<p style="font-weight: bold">No content</p>")}

I reciece a mail uploaded as attachment.

Why doens't he shows the HTML and CSS tags like i would expect when we doesn't use conditions?
The topic has been locked.
More
11 years 9 months ago #115436 by DenisChenu
Replied by DenisChenu on topic Mixing html tags with EM
Here you mix " for EM and " inside expression .

try:
Code:
{if(Q01 == "Y" OR Q02 == "Y","<p style='font-weight: bold'>Example content for the body</p><p>Second part of the content for the body</p>","<p style='font-weight: bold'>No content</p>")}

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 topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose