Search code examples
javahtmltemplatesvaadinvaadin7

Using HTML template inside Vaadin application


I have one situation where I need to use external Email HTML template, compile and populate it with data, attach with Email as body and send it. I have used CustomLayout class for using custom html template but not sure if I can use something similar for above case. Is it possible to generate String HTML representation of Vaadin components (such as rendered CustomLayout) ?


Solution

  • It's possible to get the generated HTML from client side and transfer it to the server by creating your own client-side extension or by using this example: Dumping the Screen.

    But if you want to create templates for you emails I suggest to use an approach where you use a template library that generates the html for your email.