Interface IMailBody


  • @StableMinor(version="14.0",
                 sinceVersion="4.0")
    public interface IMailBody
    Stores information of the mail body.
    Since:
    4.0.4
    Version:
    $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
    • Method Detail

      • getAttachments

        Collection<IMailAttachment> getAttachments()
        Returns a collection of attachments for this mail. This collection may be manipulated by obtaining it using this method, and then using the collection api.
        Returns:
        the collection of attachments for this mail.
        Since:
        4.0.4
        See Also:
        ISendMailManager.createMailAttachment()
      • getHtmlMsg

        String getHtmlMsg()
        The HTML message in the body, or null if there is no HTML message.

        The value returned has all relative paths converted into absolute paths using the PortalContext.getFrameworkUrl() to compose all paths. Absolute paths are not changed. The persisted original value is not changed.

        Returns:
        the HTML message in the body.
        Since:
        4.0.4
        See Also:
        getTextMsg()
      • setHtmlMsg

        void setHtmlMsg​(String htmlMsg)
        Sets the HTML message in the body. Relative paths are converted into absolute paths in the value returned by getHtmlMsg().
        Parameters:
        htmlMsg - the HTML message value to set.
        Since:
        4.0.4
        See Also:
        setTextMsg(String), getHtmlMsg()
      • getTextMsg

        String getTextMsg()
        Returns the text message in the body, or null if there is no text message. If a html message was also set, the text message will be used as a fallback by email clients that has no html support.
        Returns:
        the text message in the body.
        Since:
        4.0.4
        See Also:
        getHtmlMsg()
      • setTextMsg

        void setTextMsg​(String textMsg)
        Sets the text message for this mail.
        Parameters:
        textMsg - the text message value.
        Since:
        4.0.4
        See Also:
        getTextMsg(), setHtmlMsg(String)
      • getLocale

        Locale getLocale()
        Returns the locale of the message in this mail body.
        Returns:
        the locale.
        Since:
        10.0.0
      • setLocale

        void setLocale​(Locale locale)
        Sets the locale of the message in this mail body.

        By default the mail body has the portal's default locale.

        Parameters:
        locale - the locale to set. Cannot be null.
        Since:
        10.0.0