Search

20.4. Tags

download PDF
Emails are generated using tags in the http://jboss.com/products/seam/mail namespace. Documents should always have the message tag at the root of the message. The message tag prepares Seam to generate an email.
Facelets standard templating tags can be used as normal. Inside the body, you can use any JSF tag. If the tag requires access to external resources such as stylesheets or JavaScript, be sure to set the urlBase.
<m:message>
Root tag of a mail message.
  • importance — Sets the importance of the mail message. Valid values are low, normal, or high. Defaults to normal.
  • precedence — Sets the precedence of the message, for example, bulk.
  • requestReadReceipt — If set, a read receipt request will be added, and the read receipt will be sent to the From: address. Defaults to false.
  • urlBase — If set, the value is prepended to the requestContextPath, allowing you to use components such as <h:graphicImage> in your emails.
  • messageId — Explicitly sets the Message-ID.
<m:from>
Sets the From: address for the email. Only one exists per email.
  • name — The name that the email comes from.
  • address — The email address that the email comes from.
<m:replyTo>
Sets the Reply-to: address for the email. Only one exists per email.
  • address — the email address the email comes from.
<m:to>
Adds a recipient to the email. Use multiple <m:to> tags for multiple recipients. This tag can be safely placed inside a repeat tag such as <ui:repeat>.
  • name — The name of the recipient.
  • address — The email address of the recipient.
<m:cc>
Adds a CC recipient to the email. Use multiple <m:cc> tags for multiple CCs. This tag can be safely placed inside a iterator tag such as <ui:repeat>.
  • name — The name of the recipient.
  • address — The email address of the recipient.
<m:bcc>
Adds a BCC recipient to the email. Use multiple <m:bcc> tags for multiple bccs. This tag can be safely placed inside a repeat tag such as <ui:repeat>.
  • name — The name of the recipient.
  • address — The email address of the recipient.
<m:header>
Adds a header to the email. (For example, X-Sent-From: JBoss Seam.)
  • name — The name of the header to add. (For example, X-Sent-From.)
  • value — The value of the header to add. (For example, JBoss Seam.)
<m:attachment>
Adds an attachment to the email.
  • value — The file to attach:
    • String — A String is interpreted as a path to file within the classpath.
    • java.io.File — An EL expression can reference a File object.
    • java.net.URL — An EL expression can reference a URL object.
    • java.io.InputStream — An EL expression can reference an InputStream. In this case both a fileName and a contentType must be specified.
    • byte[] — An EL expression can reference a byte[]. In this case both a fileName and a contentType must be specified.
    If the value attribute is ommitted:
    • If this tag contains a <p:document> tag, the document described will be generated and attached to the email. A fileName should be specified.
    • If this tag contains other JSF tags, a HTML document will be generated from them and attached to the email. A fileName should be specified.
  • fileName — Specifies the file name to use for the attached file.
  • contentType — Specifies the MIME type of the attached file.
<m:subject>
Sets the subject for the email.
<m:body>
Sets the body for the email. Supports an alternative facet which, if a HTML email is generated, can contain alternative text for a mail reader which doesn't support HTML.
  • type — If set to plain, a plain text email will be generated. Otherwise, a HTML email is generated.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.