Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emailings doesn't accept HTML anymore #16393

Closed
Anard opened this issue Feb 23, 2021 · 3 comments
Closed

Emailings doesn't accept HTML anymore #16393

Anard opened this issue Feb 23, 2021 · 3 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@Anard
Copy link

Anard commented Feb 23, 2021

Bug

<!DOCTYPE html> is cleared by the editor and replaced by < html>

Environment

  • Version: 13.0.0 , 13.0.1
  • OS: Debian 10 Buster
  • Web server: Apache 2.4.38
  • PHP: PHP 7.3.27-1
  • Database: Mysql 8.0.23
  • URL(s): comm/mailing/card.php

Expected and actual behavior

All mails are sent without the DOCTYPE, so readable as text only messages.

Steps to reproduce the behavior

Just create of edit a mailing with a <!DOCTYPE html> line

Current solution

In comm/mailing/card.php, replacing all 'resticthtml' by 'none' temporarly resolve the issue.

@Anard Anard added the Bug This is a bug (something does not work as expected) label Feb 23, 2021
@eldy
Copy link
Member

eldy commented Feb 23, 2021

Which editor do you use, the ckeditor or the html editor ?
In both cases, why adding the "", you must just enter a content of a body into the html editor, no need to add html header. How do you add it ? By a cut and paste ?

@Anard
Copy link
Author

Anard commented Feb 23, 2021

Thx for ur answer.

I create my web page with in <head> the <style> tag for CSS.
A CSS class is hidden on the web site and I simply copy and paste the web page in Dolibarr's emailing addon (with Edit HTML button) and comment the hidden class so it makes visible a link to the hosted page.
So in the header of the mail you have a If this mail isn't shown clearly in your mailbox, click this link which isn't visible on the hosted website.

I've tested to send the emailing to my address without the DOCTYPE (via Dolibarr), but it appears in full text, not in HTML.

Sry for bad translations, I only use french, even in Dolibarr's interface...
So in French :

<!DOCTYPE html>
<html lang="fr">
  <head>
	<title>...</title>
	<meta charset="utf-8" />
    <style>
    	/* Comment this line to send by mail */
    	.info { display: none; }
[...]
    </style>  
  </head>
  
  <body>
  	<div class="info">Si vous ne visualisez pas correctement cet email, veuillez vous rendre à <a href="...">cette adresse</a>.</div>

So if I remove entirely my HTML header, I lose all my CSS style...

@eldy eldy closed this as completed in b7e2c7d Feb 26, 2021
@Anard
Copy link
Author

Anard commented Jul 25, 2021

Hi back.
I still have this issue. When I write a html emailing, Dolibarr's editor erase my 'style' and '/style' tags, so all my CSS is written in plain text on received email.
I searched in Dolibarr's code and don't understand why :

/var/www/localhost $ cat comm/mailing/card.php | grep NOSTYLECHECK
if (!defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1');

/var/www/localhost $ cat main.inc.php | grep NOSTYLECHECK
	if (!defined('NOSTYLECHECK')) $inj += preg_match('/<style/i', $val);

The only solution I found for the moment is, after each Dolibarr's update, to replace 'restricthtml' by 'none' in comm/mailing/card.php

Thx for helping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants