Class PersonalizedMailMessage


  • public abstract class PersonalizedMailMessage
    extends java.lang.Object
    This class is intended to send personal mail to member. Example of use:
     PersonalizedMailMessage mail = new PersonalizedMailMessage() {
       public String getOrigin() {
         return "MyCustomNotification";
       }
       public String getSubject(Member mbr) {
         return "A personal mail for " + mbr;
       };
       public String getContentText(Member mbr) {
         return mbr.getFriendlyName() + ",\n\nThis is a personal mail for you...\n";
       }
     };
     mail.sendInThread(myMemberSet);
     
    Since:
    jcms-7.0.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentHtml​(Member mbr)
      Returns the HTML content of the mail.
      java.lang.String getContentText​(Member mbr)
      Returns the text content of the mail.
      java.lang.String getFrom​(Member mbr)
      Returns the "from" part of the mail.
      abstract java.lang.String getOrigin()
      Returns the origin used for the MailMessage.
      abstract java.lang.String getSubject​(Member mbr)
      Returns the subject of the mail.
      java.lang.String getThread()
      Returns the thread name of the MailMessage.
      boolean isRecipient​(Member mbr)
      Checks if the mail must be sent to the given member.
      void send​(Member mbr)
      Sends this mail to a member.
      void send​(java.util.Collection<Member> memberColl)
      Sends this mail to a collection of member.
      void sendInThread​(java.util.Collection<Member> memberColl)
      Sends this mail to a collection of member in a new thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PersonalizedMailMessage

        public PersonalizedMailMessage()
    • Method Detail

      • getOrigin

        public abstract java.lang.String getOrigin()
        Returns the origin used for the MailMessage.
        Returns:
        the origin used for the MailMessage.
        Since:
        jcms-7.0.0
      • getSubject

        public abstract java.lang.String getSubject​(Member mbr)
        Returns the subject of the mail.
        Parameters:
        mbr - the member
        Returns:
        the subject of the mail.
        Since:
        jcms-7.0.0
      • getContentText

        public java.lang.String getContentText​(Member mbr)
        Returns the text content of the mail.
        Parameters:
        mbr - the member
        Returns:
        the content text of the mail.
        Since:
        jcms-7.0.0
      • getContentHtml

        public java.lang.String getContentHtml​(Member mbr)
        Returns the HTML content of the mail.
        Parameters:
        mbr - the member
        Returns:
        the HTML content of the mail.
        Since:
        jcms-7.0.0
      • getFrom

        public java.lang.String getFrom​(Member mbr)
        Returns the "from" part of the mail.
        Parameters:
        mbr - the member
        Returns:
        the "from" part of the mail.
        Since:
        jcms-7.0.0
      • isRecipient

        public boolean isRecipient​(Member mbr)
        Checks if the mail must be sent to the given member.
        Parameters:
        mbr - the member
        Returns:
        true if the mail must be sent to the given member.
        Since:
        jcms-7.0.0
      • getThread

        public java.lang.String getThread()
        Returns the thread name of the MailMessage.
        Returns:
        the thread name of the MailMessage.
        Since:
        jcms-7.0.0
      • send

        public void send​(java.util.Collection<Member> memberColl)
        Sends this mail to a collection of member.
        Parameters:
        memberColl - a collection of member.
        Since:
        jcms-7.0.0
      • sendInThread

        public void sendInThread​(java.util.Collection<Member> memberColl)
        Sends this mail to a collection of member in a new thread.
        Parameters:
        memberColl - a collection of member
        Since:
        jcms-7.0.0
      • send

        public void send​(Member mbr)
        Sends this mail to a member.
        Parameters:
        mbr - the member
        Since:
        jcms-7.0.0