It's all about the answers!

Ask a question

Fetch configuration values

Jan Šťastný (1212147) | asked Mar 16 '10, 6:24 a.m.
I wrote an event handler that sends emails to certain people upon certain events. I can successfully send emails using the IMailerService. I'd like to use the values for sender (From email, from name, reply-to) from the configuration.

I try to do it this way (inspired by another mailing class from SDK):

public class ChangeEventHandler extends AbstractService implements
IChangeEventHandler {

private static final String TASK_ID_PROP_PREFIX = "notification.mail."; //$NON-NLS-1$
public static final String PROP_REPLY = TASK_ID_PROP_PREFIX + "reply"; //$NON-NLS-1$
public static final String PROP_FROM_NAME = TASK_ID_PROP_PREFIX
+ "from_name"; //$NON-NLS-1$
public static final String PROP_FROM = TASK_ID_PROP_PREFIX + "from"; //$NON-NLS-1$


String reply = getStringConfigProperty(PROP_REPLY);
String fromName = getStringConfigProperty(PROP_FROM_NAME);
String from = getStringConfigProperty(PROP_FROM);

In this piece of code, all the 3 variables will be null.

The situation is same when running RTC on Jetty and Tomcat.

Be the first one to answer this question!

Register or to post your answer.