Project

General

Profile

Wt HTML to email

Added by Richard Bingham almost 12 years ago

Hello folks, my client wants to be able to take something like an invoice or statement that is shown on the web (using Wt) and email it.

I haven't played with it yet, but the Wt email classes do seem to have the ability to be given HTML with addHtmlBody(). I'm thinking of using this along with htmlText() from the container, so the email they get looks similar to the page. I'm sure I'll have to disable everything, such as Java, to get it down to just HTML, but does this seem doable, or should I be looking at another solution? Does something already exist?

Thanks in advance for any thoughts or suggestions on this.

Richard.


Replies (1)

RE: Wt HTML to email - Added by Koen Deforche almost 12 years ago

Hey Richard,

It could in theory work, but anything that is not inline style will not be copied over.

Also, anything that requires JavaScript to render correctly (layouts for example) will not work out ok.

So it will depend to a large extent on what kind of contents you have there.

I've never tried it, but htmlText() is used for example to render a widget into a WTemplate, so it is well supported by all widgets.

If the widget contains JavaScript components, they will be rendered to the application however, so we might want to foresee an option to disable this (that would be an easy change to WWidget::htmlText().

Regards,

koen

    (1-1/1)