Skip to main content
1-Visitor
December 11, 2014
Solved

How can I get the email address of the administrator in Windchill ?

  • December 11, 2014
  • 8 replies
  • 10350 views

I have a java method that will send an email when dxf creation failes but how I can get the email address of the administrator configurated at Windchill ?

I hardcoded the email address now but it should be better if the java class does not need adaption when the administrator should ever change.

Best regards,

Bernard

Best answer by Prabhash

Bernard, Once you have the admin as a WTPrincipal object, you can use below lines to fetch emailAddress dynamically:

String adminEmailId = null;

if(WTUser.class.isAssignableFrom(admin.getClass())){

WTUser adminUser = (WTUser)admin;

adminEmailId = adminUser.getEMail();

}

-Prabhash

8 replies

23-Emerald IV
December 11, 2014

Not sure if it helps any, but the administrator's email address is listed in the wt.properties file. Maybe you can either retrieve the property with Java or manually parse the file. (It's available anonymously from <windchill url>/Windchill/wt.properties)

Look for these properties:

wt.mail.from=

wt.org.principalAdministratorEmail=

wt.notify.notificationSenderEmail=

1-Visitor
December 12, 2014

The wt.mail.from is the senders email address (WindchillAlerts@lvd.be), I was looking for the administrator that is configurated via Site/Administrators, see picture a litle further.

12-Amethyst
December 11, 2014

Another question would be which administrator(s) you want to contact.

For instance, in 10.2 (and maybe 10.1, I forget), the JMX-Administrators list is initially populated with the e-mail address entered at install time and this list can adjusted from that point to include more e-mail addresses.

1-Visitor
December 12, 2014

I like to mail the Site administrator like in next picture. We are still running 9.1Snap1.jpg

1-Visitor
December 12, 2014

Hello Bernard,

I guess you can use SessionHelper.manager.getAdministrator() to fetch the wcadmin user.

Let me know if you need any clarification.

-Prabhash