Welcome to the LimeSurvey Community Forum

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

Email template code alteration

  • LouisGac
  • LouisGac's Avatar
  • New Member
  • New Member
More
6 years 6 months ago #180118 by LouisGac
Replied by LouisGac on topic Email template code alteration
email template editor -> show source code
The topic has been locked.
More
6 years 6 months ago #180119 by Elita
really? try that yourself!!
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • New Member
  • New Member
More
6 years 6 months ago #180121 by LouisGac
Replied by LouisGac on topic Email template code alteration
so, here the function to send mail:
github.com/LimeSurvey/LimeSurvey/blob/ma...mon_helper.php#L2199

As you can see here:
github.com/LimeSurvey/LimeSurvey/blob/ma...lper.php#L2310-L2314
Code:
if ($ishtml) {
        $mail->IsHTML(true);
        if (strpos($body, "<html>") === false) {
            $body = "<html>".$body."</html>";
        }

If HTML mail is enable, and if the source code of the mail does not contain the string "<html>", then the function add it.
The topic has been locked.
More
6 years 6 months ago #180122 by Elita
thanks. so back to my initial question:
How to add to the HTML head this:
1. <!DOCTYPE> should be the first element seen
2. the <head> tag must contain a title
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • New Member
  • New Member
More
6 years 6 months ago #180123 by LouisGac
Replied by LouisGac on topic Email template code alteration
If your mail body contains the string "<html>" then the function will not change it.
So, as I told you 2 messages up, use "show source" button, and add your header and code in the mail...
The topic has been locked.
More
6 years 6 months ago - 6 years 6 months ago #180136 by Elita
nope. my email does not contain nothing. i used limesurvey built - in invitation email with what i got that error.
so. if i added proper head to the "email body" as you named it in the template editor using code editor, there will not be another head generated by the built-in script?
if so, do you think that is the proper way of handling this?
Last edit: 6 years 6 months ago by Elita.
The topic has been locked.
More
6 years 6 months ago #180137 by jelo
Replied by jelo on topic Email template code alteration

Elita wrote: if i added proper head to the "email body" as you named it in the template editor using code editor, there will not be another head generated by the built-in script?

You can provide a complete HTML page as email via the sourcemode of the editor.
As long as your HTML source contains the <HTML> tag, LimeSurvey will not add it's own stuff during generating emails.
You cannot edit the HTML stuff LimeSurvey generates, you can override it with your own html sourcecode.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu, Elita, LouisGac
The topic has been locked.
More
6 years 6 months ago #180199 by Elita
Thank you all for your time!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose