Fetch configuration values
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 teamserver.properties configuration.
I try to do it this way (inspired by another mailing class from SDK):
In this piece of code, all the 3 variables will be null.
The situation is same when running RTC on Jetty and Tomcat.
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.