com.jalios.jcms.mail
Class PersonalizedMailMessage

java.lang.Object
  extended by com.jalios.jcms.mail.PersonalizedMailMessage

public abstract class PersonalizedMailMessage
extends 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

Constructor Summary
PersonalizedMailMessage()
           
 
Method Summary
 String getContentHtml(Member mbr)
          Returns the HTML content of the mail.
 String getContentText(Member mbr)
          Returns the text content of the mail.
 String getFrom(Member mbr)
          Returns the "from" part of the mail.
abstract  String getOrigin()
          Returns the origin used for the MailMessage.
abstract  String getSubject(Member mbr)
          Returns the subject of the mail.
 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(Collection<Member> memberColl)
          Sends this mail to a collection of member.
 void send(Member mbr)
          Sends this mail to a member.
 void sendInThread(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 String getOrigin()
Returns the origin used for the MailMessage.

Returns:
the origin used for the MailMessage.
Since:
jcms-7.0.0

getSubject

public abstract 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 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 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 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 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(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(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


Copyright © 2001-2010 Jalios SA. All Rights Reserved.