Forums / Setup & design / Generate HTML email from XML block content attribute

Generate HTML email from XML block content attribute

Author Message

Michal Slocinski

Thursday 09 December 2010 9:42:08 am

Hi!

I have an extension which sends HTML emails to users and administrators of the portal.

I would like to make these emails customizable and be able to define content of these emails using Online Editor. I know how to fetch content of an attribute, put it into the email and send it out however I don't know how to transform content of an attribute edited with Online Editor into HTML.

Could someone point me to the right class that will do the job?

Ivo Lukac

Friday 10 December 2010 2:25:49 am

Try this:

{$node.data_map.YOUR_EDITOR_ATTRIBUTE.content.output.output_text}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Daisy Radix

Friday 10 December 2010 8:32:50 am

In php you can use the methode which convert xml to html :

$converter = new eZXHTMLXMLOutput( your_xml_content, false, your_attribute);

$converter ->outputText();

You maybe can use it in custom operator template...

eZ Publish certified developper :http://auth.ez.no/certification/verify/378142

Quoc Huy Nguyen Dinh

Friday 10 December 2010 6:04:36 pm

Or you can also create a template override to view the node containing the XML attribute. Then create a module view that would open the URL (fopen or curl) get the HTML and send it out. This will also allow you to have a URL for the link for "if you have trouble viewing this email, click here".

Michal Slocinski

Saturday 11 December 2010 12:37:52 am

"

In php you can use the methode which convert xml to html :

$converter = new eZXHTMLXMLOutput( your_xml_content, false, your_attribute);

$converter ->outputText();

You maybe can use it in custom operator template...

"

excellent, this did the job!