<Email ListLocation

Installation Docs
API Docs


Implementing a list location

To load a list of addresses for the deliverance server you may not wish to use or database or a text file in th eformat of the supplied examples. This document explains how to implement your own list location.

In this example you are going to load the list every time the JSP is loaded and run so that if the underlying data changes(list of addresses) it is reflected when the emails are sent.

first create a Java source file called MyEmailList.java
create an no arguments constructor
public MyEmailList(){
ensure the main public MyEmailList class implements the following interface
If you want to you can extend com.tp23.deliverance.AbstractEmailLocation so you get the required getAddresses() method and a setAddresses(InternetAddress[] newSet) method which you should use to populate the addresses.

if you want to be able to pass configuration options in the data.xml file ensure the main class implements.
you will need to implement the following two methods
  • public void configure(Properties config)
  • public Properties getConfig()
When the class is first loaded any configuration items in the XML file will be passed in the Properties object to the configure method.
Any - characters will be replaced with . characters. For example
<email-property-number value="23a"/>
will be accessible by calling config.getProperty("email.property.number") in the configure method, which will return the String "23a".
To create the list of email addresses you should now override the public InternetAddress[] getAddresses() method.
public InternetAddress[] getAddresses(){
	// get addresses from the LDAP server
	InternetAddress[] addresses = getAllFromLdap();
	return addresses
If you want to cache the addresses and you have subclassed AbstractEmailLocation you could override the email getAddresses() method as follows
public InternetAddress[] getAddresses(){
	InternetAddress[] addresses = getAddresses();
		// get addresses from the LDAP server
		addresses = getAllFromLdap();
	return addresses
You would now need to ensure you call the setAddresses() method when the ldap changes to send mail to the full list.~