/// <summary> /// O gün doğum günü olan Kişi'leri yaratılan Pazarlama Listesi(SMS)'ne ekler. /// </summary> /// <param name="service"></param> /// <param name="ListId"></param> /// <param name="CampaignActivityId"></param> private static void CreateListContactConnectionForSmsList(IOrganizationService service, Guid ListId, Guid CampaignActivityId) { #region | Members | DataTable GetContacts = new DataTable(); GetContacts = GetContactsForSmsCampaignActivityList(); #endregion | Members | try { if (GetContacts.Rows.Count > 0) { foreach (DataRow contact in GetContacts.Rows) { Guid ContactId = new Guid(contact["ContactId"].ToString()); AddListMembersListRequest req = new AddListMembersListRequest(); req.ListId = ListId; req.MemberIds = new Guid[] { ContactId }; AddListMembersListResponse response = (AddListMembersListResponse)service.Execute(req); } } // SendSmsIntegration(service, ListId, CampaignActivityId); } catch (Exception ex) { throw new Exception("CreateListContactConnectionForSmsList"); } }
public static void AddToMarketingList(Guid[] listMembers, Guid listId) { AddListMembersListRequest request = new AddListMembersListRequest(); request.MemberIds = listMembers; request.ListId = listId; AddListMembersListResponse response = XrmCore.Execute <AddListMembersListRequest, AddListMembersListResponse>(request); }