Forums

Home » Liferay Portal » English » Liferay Legacy

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dane Dane
Email addresses
April 17, 2007 7:52 AM
Answer

Dane Dane

Rank: New Member

Posts: 9

Join Date: July 18, 2006

Recent Posts

Hi,

I would like to retrieve all the email addresses from a User. I found that it should be possible to do that with EmailAddressLocalServiceUtil but when i try

List<com.liferay.portal.model.EmailAddress> emails = EmailAddressLocalServiceUtil.getEmailAddresses(user.getCompanyId(),
User.class.getName(), user.getPrimaryKey());

or

List<com.liferay.portal.model.EmailAddress> emails = EmailAddressLocalServiceUtil.getEmailAddresses(user.getCompanyId(),
User.class.getName(), user.getUserId());

i receive no email addresses, which are configured via the Enterprise Admin portlet under
Email Addresses tab.

So, my question would be hot to retrieve those email addresses?
And my second question would be to know if it is possible to know somehow in an application deployed under liferay that a new email address was added via th enterprise portlet?

Regards,
Daniel
Dane Dane
RE: Email addresses
April 18, 2007 4:27 AM
Answer

Dane Dane

Rank: New Member

Posts: 9

Join Date: July 18, 2006

Recent Posts

Any hint from Liferay guys?

How to retrieve Email addresses? Is that possible at least?
Dane Dane
RE: Email addresses
April 19, 2007 9:39 AM
Answer

Dane Dane

Rank: New Member

Posts: 9

Join Date: July 18, 2006

Recent Posts

The secret was in the Contact class.

List<com.liferay.portal.model.EmailAddress> emails = EmailAddressLocalServiceUtil.getEmailAddresses(
user.getCompanyId(), Contact.class.getName(), user.getUserId());

Anyway, thank you guys.

Regards,
Daniel
Fabio Foglia
RE: Email addresses
September 23, 2011 5:42 AM
Answer

Fabio Foglia

Rank: Junior Member

Posts: 61

Join Date: September 2, 2011

Recent Posts

wrong for me....

...the right command is:

List<com.liferay.portal.model.EmailAddress> emails = EmailAddressLocalServiceUtil.getEmailAddresses(
user.getCompanyId(), Contact.class.getName(), user.getContactId());
jorge alarcon
RE: Email addresses
November 1, 2011 4:56 PM
Answer

jorge alarcon

Rank: New Member

Posts: 4

Join Date: November 1, 2011

Recent Posts

Why would you want to do that?