Adding a user to contact list

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can add a user to current user's contact list using the API.

 

[C#]

 

using CMS.Messaging;

using CMS.CMSHelper;

using CMS.SiteProvider;

using CMS.GlobalHelper;

 

...

 

  // Adds administrator to CurrentUser's Contact list

  UserInfo user = UserInfoProvider.GetUserInfo("administrator");

  ContactListInfoProvider.AddToContactList(CMSContext.CurrentUser.UserID, user.UserID);

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?adding_a_user_to_a_contact_list.htm