Welcome to the LimeSurvey Community Forum

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

Mixing html tags with EM

More
9 years 4 months ago #115233 by jelle
Mixing html tags with EM was created by jelle
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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 months ago - 9 years 4 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 service on demand , plugin development .
I don't answer to private message.
Last edit: 9 years 4 months ago by DenisChenu.
The topic has been locked.
More
9 years 4 months ago #115247 by jelle
Replied by jelle on 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?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 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 : 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 , plugin development .
I don't answer to private message.
The topic has been locked.
More
9 years 4 months ago #115428 by TomDh
Replied by TomDh on 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?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 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 service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose