Interface IMailBody


  • @StableMinor(version="16.0",
                 sinceVersion="4.0")
    public interface IMailBody
    Stores information of the mail body.
    Since:
    4.0.4
    Version:
    $Revision: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Collection<IMailAttachment> getAttachments()
      Returns a collection of attachments for this mail.
      java.lang.String getHtmlMsg()
      The HTML message in the body, or null if there is no HTML message.
      java.util.Locale getLocale()
      Returns the locale of the message in this mail body.
      java.lang.String getTextMsg()
      Returns the text message in the body, or null if there is no text message.
      void setHtmlMsg​(java.lang.String htmlMsg)
      Sets the HTML message in the body.
      void setLocale​(java.util.Locale locale)
      Sets the locale of the message in this mail body.
      void setTextMsg​(java.lang.String textMsg)
      Sets the text message for this mail.
    • Method Detail

      • getAttachments

        java.util.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

        java.lang.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​(java.lang.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

        java.lang.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​(java.lang.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

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

        void setLocale​(java.util.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