I use the Tridion.OutboundEmail.ContentManagement API to get and manage contact details.
Getting contacts works fine since it returns an ExtendedDetails dictionary, but the TcmUriCollection keywords are always empty.
[Test] public void GetContacts_via_address_book() { var uri = new TcmUri(101, 2, TcmItemTypes.StaticAddressBook); var addressBook = new StaticAddressBook(uri); var contacts = addressBook.GetContacts(); foreach (var contact in contacts) { var firstName = contact.ExtendedDetails["NAME"].StringValue; Assert.That(contact.EmailAddress, Is.Not.Empty);
I also tried the following method:
[Test] public void GetContacts_via_filter() { var uri = new TcmUri(101, 2, TcmItemTypes.StaticAddressBook); var addressBook = new StaticAddressBook(uri); var filter = new ContactFilter(UserContext.Current); var contacts = Contact.GetContacts(filter, addressBook); foreach (var contact in contacts) { var firstName = contact.ExtendedDetails["NAME"].StringValue; Assert.That(contact.EmailAddress, Is.Not.Empty);
I can even add a keyword to the contact keywords collection and save it, and it displays correctly in Tridion, but when I get the same contact again, the collection is empty again.
Does anyone have experience with this API and / or know what the problem is?
source share