Interface IMessage


public interface IMessage
This bean represents the message in velocity. It's used when running velocity templates during inbound processing.
  • Method Details

    • getMessageID

      String getMessageID()
      Returns:
      the message's mime id
    • getSentDate

      Date getSentDate() throws javax.mail.MessagingException
      Returns:
      the message sent date derived from header value
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getSubject

      String getSubject() throws javax.mail.MessagingException
      Returns:
      the message subject
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getFrom

      IEmailAndPersonal getFrom() throws javax.mail.MessagingException
      Returns:
      the sending from (email and personal) address or null.
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getReplyTo

      IEmailAndPersonal getReplyTo() throws javax.mail.MessagingException
      Returns:
      the reply to header email and personal
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getSender

      IEmailAndPersonal getSender(List<String> customHeaders) throws javax.mail.MessagingException
      Parameters:
      customHeaders - a list of header names to check in order
      Returns:
      the email and personal from the headers according to the strategy
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getTo

      List<IEmailAndPersonal> getTo() throws javax.mail.MessagingException
      Returns:
      The TO addresses
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getCc

      List<IEmailAndPersonal> getCc() throws javax.mail.MessagingException
      Returns:
      The CC addresses
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getBcc

      List<IEmailAndPersonal> getBcc() throws javax.mail.MessagingException
      Returns:
      The BCC addresses
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getRecipients

      List<IEmailAndPersonal> getRecipients() throws javax.mail.MessagingException
      Returns:
      all the TO, CC and BCC addresses
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getRecipients

      List<IEmailAndPersonal> getRecipients(List<String> headers) throws javax.mail.MessagingException
      Parameters:
      headers - extra header names to where to find more recipients.
      Returns:
      all the TO, CC and BCC addresses including extra headers selected in the parameters.
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getBody

      String getBody() throws javax.mail.MessagingException
      Returns:
      the body, preferably text, if not found, the html body.
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getFormat

      NotificationFormat getFormat() throws javax.mail.MessagingException
      Returns:
      the format of the body.
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getInReplyToMessageIDs

      Set<String> getInReplyToMessageIDs() throws javax.mail.MessagingException
      Returns:
      the in-reply-to header values
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getReferencesMessageIDs

      Set<String> getReferencesMessageIDs() throws javax.mail.MessagingException
      Returns:
      the references header values
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getHeaderNames

      Set<String> getHeaderNames() throws javax.mail.MessagingException
      Returns:
      All the email header names
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.
    • getHeader

      List<String> getHeader(String name) throws javax.mail.MessagingException
      Returns a list of unprocessed values, each line is a value. Note: this method doesn't split values in each line Example: To: to1@mail.com, to2@mail.com,to3@mail.com To: to4@mail.com, to5@mail.com

      Assert.assertEquals(Arrays.asList("to1@mail.com, to2@mail.com,to3@mail.com", "to4@mail.com, to5@mail.com"), message.getHeader("To"));

      Parameters:
      name - the header name
      Returns:
      a list with 2 values of the header with the provided name;
      Throws:
      javax.mail.MessagingException - if there is an error reading from the mime email.