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