Mixing html tags with EM

More
2 years 11 months ago #115233 by jelle
jelle created the topic: Mixing html tags with EM
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?

Please Log in to join the conversation.

More
2 years 11 months ago #115238 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
2 years 11 months ago - 2 years 11 months ago #115246 by DenisChenu
DenisChenu replied the topic: Mixing html tags with EM
Hi,

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

But without XSS (and HTML editor set to popup) I already used this:
{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 service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 2 years 11 months ago by DenisChenu.

Please Log in to join the conversation.

More
2 years 11 months ago #115247 by jelle
jelle replied the topic: Mixing html tags with EM
Would it help to insert the template directly in the database without opening the template editor in the tool?

Please Log in to join the conversation.

More
2 years 11 months ago #115250 by DenisChenu
DenisChenu replied the 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 : manual.limesurvey.org/First_login_-_Your_user_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 service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
2 years 11 months ago #115428 by TomDh
TomDh replied the topic: Mixing html tags with EM
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?
Attachments:

Please Log in to join the conversation.

More
2 years 11 months ago #115436 by DenisChenu
DenisChenu replied the topic: Mixing html tags with EM
Here you mix " for EM and " inside expression .

try:
{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 service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!