think123 think123 - 2 months ago 5x
Smarty Question

Is it possible to convert Smarty template to HTML without outputting it to the page?


method in Smarty converts the Smarty template to HTML, and then outputs that to the page.

Is there any way that I can convert a Smarty template to HTML, and save the contents of such in a variable?

I want to use Smarty to render an email template, but then obviously send that email to a user.


Yes, there is a fetch() method for exactly this purpose. It takes all the same parameters as the display() method and the two are cross-referenced in the documentation.