I am trying to add existing sitecore user to the recipient list. I have created empty recipient list using list manager. Below is my code.
RecipientId recipient = new SitecoreUserName(userProfile.UserName);
var listRepository = new ListManagerCollectionRepository();
var newsRecipientList = listRepository.GetEditableRecipientCollection("{list-id}");
if (!newsRecipientList.Contains(recipient).Value)
{
newsRecipientList.AddRecipient(recipient);
}
However when I see my recipient list it is always empty. Please Help.