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.




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: