Forums

WYSIWYG Editor Sending Code in Email

woogygun 11 Jun, 2013
Hi there Guys

Ok so i have a form that is serving as a feedback form. I initially had a text area with editor turned on, but i could not pre populate the textarea with the HTML needed. So i have implemented a custom PHP/HTML element with the following:

<?php
$editor =& JFactory::getEditor();
echo $editor->display( 'fulltext',  '<div style="width:700px !important;"><img src="http://www.gearhouse.co.za/images/gearhouse_sales_mailer_header.png" width="700" height="217" alt=""/><p font-family: "Trebuchet MS", Helvetica, sans-serif;>Dear {Client Name},</p><p font-family: "Trebuchet MS", Helvetica, sans-serif;>Thank you for taking the time to meet with me yesterday to discuss your event requirements for the future and how Gearhouse can be of service to you.</p>

<p font-family: "Trebuchet MS", Helvetica, sans-serif;>We would really appreciate the opportunity to quote you on any future events you might have. I believe that Gearhouse can offer you a very professional and affordable alternative to other suppliers, with the convenience of having everything under one roof, and we are committed to providing the very best in service, equipment and personnel.</p>

<p font-family: "Trebuchet MS", Helvetica, sans-serif;>For your interest, I have attached a copy of our {company_brochure} brochure, as our discussion led me to believe that this service may be of interest to you for {explanation}.</p>

<p font-family: "Trebuchet MS", Helvetica, sans-serif;>I would be happy to provide you with additional information, as needed. Simply call me on +27836073036; otherwise, I will follow up with you once you have received your quotation.</p><p font-family: "Trebuchet MS", Helvetica, sans-serif;><span  style="color: #002b7f; font-weight: bold;">Graeme Marshall</span><br />
Sales Executive<br />
Gearhouse Group</p>
<p font-family: "Trebuchet MS", Helvetica, sans-serif;><span  style="color: #002b7f; font-weight: bold;">Gearhouse SA (Pty) Ltd</span><br />
Reg No 1993/002918/07</p>
<p font-family: "Trebuchet MS", Helvetica, sans-serif;><strong>Mobile:</strong>           +27836073036<br />
<strong>Fax:</strong>               +27112163100<br />
<strong>Office:</strong>           +27112163000<br />
<strong>Direct:</strong>              +27112163202</p>
<img src="http://www.gearhouse.co.za/images/footer-placeholder.png" width="700" height="154" alt=""/></div>', '80%', '350', '55', '20', false  ) ;
?>


Everything works as expected, however in the email it sends through some pieces of the PHP in calling the Editor.




How can i fix this to not send through the bits of additional code?
GreyHead 11 Jun, 2013
Hi woodygun,

My only suggestion would be to try creating the HTML as a separate string variable before the echo and see if that resolves it.
<?php
$html = '<div style="width:700 . . . ';
$editor =& JFactory::getEditor();
echo $editor->display( 'fulltext', $html, . . . );
?>


Bob
This topic is locked and no more replies can be posted.