15.1.5. Templating

15.1.5. Templating

The mail templating example shows that facelets templating Just Works with the Seam mail tags.

Our template.xhtml contains:

<m:message>
   <m:from name="Seam" address="do-not-reply@jboss.com" />
   <m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
   <m:subject>#{subject}</m:subject>
   <m:body>
       <html>
           <body>
               <ui:insert name="body">This is the default body, specified by the template.
	       </ui:insert>
           </body>
       </html>
   </m:body>
</m:message>

Our templating.xhtml contains:

<ui:param name="subject" value="Templating with Seam Mail"/>
<ui:define name="body">
    <p>This example demonstrates that you can easily use <i>facelets templating</i> in email!</p>
</ui:define>