Seam Mail & Formatting
ginni Nov 22, 2010 2:07 PMI am trying to send email with Seam and have a mail template. The content comes in a String and includes br (html line breaks) for formatting.
The template page follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<m:message
importance="high"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:m="http://jboss.com/products/seam/mail">
<m:to name="#{notification.toAddress}">#{notification.toAddress}</m:to>
<m:from name="#{notification.fromName}" address="#{notification.fromAddress}"/>
<m:subject>#{notification.subject}</m:subject>
<m:body type="html">
<ui:include src="/notifications/notification.xhtml"/>
</m:body>
</m:message>
and the include page is:
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<html>
<div style="width: 800px; height: auto">
<div style="min-height: 400px; border-top: 0px solid #ddd; padding: 20px; font-family: arial, helvetica, sans-serif; font-weight: plain; font-size: 12px">
<div class="vspace12">
<ui:fragment rendered="#{notification.content == ''}">
[Empty Content]
</ui:fragment>
<ui:fragment rendered="#{notification.content != ''}">
#{notification.content}
</ui:fragment>
</div>
</div>
</div>
</html>
</ui:composition>
When I receive the notification, however, the text is all there, but I see the html br tags, not actual line breaks. I am sure I am missing something obvious... What might that be?
Thanks!!