Since my fist days of using Phoca Email extension I wonder, why all HTML tags get lost, after the email has been sent.
Can this behaviour be changed?
Thanks for answering.
Ferdinand
Why HTML tags disappear in email text after having sent the message
- f.gruber
- Phoca Member
- Posts: 39
- Joined: 12 Sep 2012, 11:47
- Jan
- Phoca Hero
- Posts: 48416
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Why HTML tags disappear in email text after having sent the message
Hi, which HTML tags you mean? Which part do you mean? Sending email or newsletter?
Jan
Jan
If you find Phoca extensions useful, please support the project
- f.gruber
- Phoca Member
- Posts: 39
- Joined: 12 Sep 2012, 11:47
Re: Why HTML tags disappear in email text after having sent the message
This problem is related to Phoca Email.
Let me give an example:
I create a Mail message in Phoca Email using the graphical editor as usual. Now I switch to the code view, to show the created HTML. This is the HTML text:
Now I click on the SEND button. After having sent the E-Mail, the text in the editor window has changed to plain text:
As you can see, all HTML tags have got removed.
However, the recipient received the message as HTML formatted text.
Let me give an example:
I create a Mail message in Phoca Email using the graphical editor as usual. Now I switch to the code view, to show the created HTML. This is the HTML text:
Code: Select all
<h1>Message</h1>
<h2>Test</h2>
<p><em>This</em> is a <strong>HTML</strong> Mail. It was sent with <span style="color: #0000ff;">Phoca Email</span> Component.</p>
Code: Select all
<p>Message Test This is a HTML Mail. It was sent with Phoca Email Component.</p>
However, the recipient received the message as HTML formatted text.
- Jan
- Phoca Hero
- Posts: 48416
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Why HTML tags disappear in email text after having sent the message
Hi,
so my idea is following:
Phoca Email gets the HTML version and send the HTML version. The second function is to save the content but this will be stripped by editor function.
The question is, does the recipent get the right HTML? With all the set HTML tags?
Can you paste me the screenshot of situation before and after sending?
Jan
so my idea is following:
Phoca Email gets the HTML version and send the HTML version. The second function is to save the content but this will be stripped by editor function.
The question is, does the recipent get the right HTML? With all the set HTML tags?
Can you paste me the screenshot of situation before and after sending?
Jan
If you find Phoca extensions useful, please support the project
- f.gruber
- Phoca Member
- Posts: 39
- Joined: 12 Sep 2012, 11:47
Re: Why HTML tags disappear in email text after having sent the message
Yes, the recipient gets the HTML Mail including all HTML tags as expected.
Screenshot of the mail message in the editor before having sent:
Screenshot of the mail message in the editor after having sent:
- Jan
- Phoca Hero
- Posts: 48416
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Why HTML tags disappear in email text after having sent the message
Hi, when you switch to standard tinyMCE editor (for test only), do you get the same problem?
Jan
Jan
If you find Phoca extensions useful, please support the project
- f.gruber
- Phoca Member
- Posts: 39
- Joined: 12 Sep 2012, 11:47
Re: Why HTML tags disappear in email text after having sent the message
It makes no difference whether I use the TinyMCE Editor or the other. After click on SEND all HTML tags in the editor window are gone.
But the recipient gets the mail message with all HTML tags.
Maybe the title (subject) of this thread may not be entirely okay.
The right question is:
Why HTML tags disappear in the editor window after having sent the message
But the recipient gets the mail message with all HTML tags.
Maybe the title (subject) of this thread may not be entirely okay.
The right question is:
Why HTML tags disappear in the editor window after having sent the message
- Jan
- Phoca Hero
- Posts: 48416
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Why HTML tags disappear in email text after having sent the message
Hi, sorry for missunderstanding, I forgot about the limit in Joomla core, described here:
administrator/components/com_phocaemail/controllers/phocaemailwrite.php ... line 119
I will try to find out, if something changed in this area in Joomla core but it looks like the only way to solve it is the core hack
EDIT: BTW it looks like the raw methods is working in Joomla 4, so if somebody uses Joomla 4, try to open this file:
administrator/components/com_phocaemail/controllers/phocaemailwrite.php line 122
and edit from:
to:
And let me know if this is workign for you.
Jan
administrator/components/com_phocaemail/controllers/phocaemailwrite.php ... line 119
Code: Select all
// ==========================================================================================
// Remember the HTML - GUIDE to edit core file
// Comment the following line
$app->getUserStateFromRequest( $context.'message', 'message', $post['message'], 'html' );
// Uncomment the following line
//$app->getUserStateFromRequest( $context.'message', 'message', $post['message'], 'string' );
// EDIT
// file: libraries/joomla/application/application.php
// line: cca 514
// FROM:
// public function getUserStateFromRequest($key, $request, $default = null, $type = 'none')
// TO:
// public function getUserStateFromRequest($key, $request, $default = null, $type = 'none', $mask = 0)
//
// line: cca 518
// FROM:
// $new_state = $app->input->get($request, null, 'default', $type);
// TO:
// $new_state = $app->input->get($request, null, 'default', $type, $mask);
// ==========================================================================================
EDIT: BTW it looks like the raw methods is working in Joomla 4, so if somebody uses Joomla 4, try to open this file:
administrator/components/com_phocaemail/controllers/phocaemailwrite.php line 122
and edit from:
Code: Select all
$app->getUserStateFromRequest( $context.'message', 'message', $post['message'], 'html' );
Code: Select all
$app->getUserStateFromRequest( $context.'message', 'message', $post['message'], 'raw' );
Jan
If you find Phoca extensions useful, please support the project