Welcome to the LimeSurvey Community Forum

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

How to add css rules in the invitation email head-tag?

  • ramon01
  • ramon01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago - 8 years 9 months ago #121403 by ramon01
Hi,
where can i add some css rules into the HTML mail head-tag. The Editor only add the part for the body-tag.
The invitation mail i get into my inbox has a source code like this:
Code:
<html>
  <head>
    <title></title>
  </head>
  <body>
.
.
-
</body>
</html>
Where can i change this part:
Code:
<head>
    <title></title>
  </head>
Greetings
Ramon
Last edit: 8 years 9 months ago by ramon01.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #121406 by tpartner
As far as I know, you cannot modify that without hacking the core code.

Regardless, not all email clients respect styles in the <head> element - it's safer to use inline styles.

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
8 years 9 months ago #121407 by DenisChenu
Hi,

I already used sometimes css in head. I use "HTML editor in popup" and this for example:
Code:
<html><head><style>a{color:red}</style></head><body style="color:green">
You text
</body></html>
But like Tony say, it's not garanted, it work on Thunderbird and Outlook (some version).

Denis

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.
  • ramon01
  • ramon01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago #121408 by ramon01
Thanks for your reply,
i have a mail template that is testet with the major Mail Clients and need the head for media querys. I will try the Editor in Popup mode, in inline mode it was not possible to add the head tag.
Greetings
Ramon
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #121410 by DenisChenu
Hi,

With some PHP competences, i think you can do a plugin using manual.limesurvey.org/BeforeTokenEmail for this. A good idea for a plugin.

Denis

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.
  • ramon01
  • ramon01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago #121469 by ramon01
Hey,
@Denis, yes a Plugin is the best Option, i would try to make a Plugin for that. Are there some other resources to get start faster with the plugin Develoment? Some small Demo-Plugins or Tutorials? Your sendMailAjax is a little to complex to start i think.

@all, I've try to manage the problem in the Editor in Popup Mode and the system interprets the
Code:
{ }
CSS-Brackets as Placeholders :( . Is there a workaround to mask the CSS-Brackets? Because the 'Popup Editor Solution' woud be enough for the first Step.

Thanks
Ramon
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #121470 by tpartner
Insert a space or line-break after the opening brace and before the closing brace.

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
8 years 9 months ago - 8 years 9 months ago #121471 by DenisChenu
I don't think there are already a public plugin using this event.

But something like:
Code:
$message=$this->event()->get("body");
$body="<html>......<body>".$message."</body></html>";
$this->event()->set("body",$body);
Can do the trick.

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: 8 years 9 months ago by DenisChenu.
The topic has been locked.
  • ramon01
  • ramon01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago #121472 by ramon01
@tpartner: nice that works
@denis: ok, that looks fine.

Thanks
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose