Exemplo n.º 1
0
        protected void UpdateEmail(IIdentificationPayload data, Dictionary <string, Facet> facets)
        {
            EmailAddressList emails;

            if (facets.ContainsKey(EmailAddressList.DefaultFacetKey))
            {
                emails = (EmailAddressList)facets[EmailAddressList.DefaultFacetKey];
                emails.PreferredEmail = new EmailAddress(data.Email, true);
            }
            else
            {
                emails = new EmailAddressList(new EmailAddress(data.Email, true), Wellknown.PreferredEmailKey);
                facets.Add(EmailAddressList.DefaultFacetKey, emails);
            }
        }
Exemplo n.º 2
0
        public void UpdateFacet([NotNull] IIdentificationPayload data)
        {
            var trackerContact = ContactExtensions.GetCurrentTrackerContact();

            Assert.IsNotNull(trackerContact, "Current contact is null");

            var facets = trackerContact.GetXConnectFacets();

            UpdateName(data, facets);
            UpdateEmail(data, facets);

            Tracker.Current.Session.IdentifyAs(Context.Site.Domain.Name, data.Email);

            trackerContact.UpdateXConnectFacets(facets);
            UpdateXConnectContact(facets);
        }
Exemplo n.º 3
0
        protected void UpdateName(IIdentificationPayload data, Dictionary <string, Facet> facets)
        {
            PersonalInformation personalInfo;

            if (facets.ContainsKey(PersonalInformation.DefaultFacetKey))
            {
                personalInfo           = (PersonalInformation)facets[PersonalInformation.DefaultFacetKey];
                personalInfo.FirstName = data.FirstName;
                personalInfo.LastName  = data.LastName;
            }
            else
            {
                personalInfo = new PersonalInformation()
                {
                    FirstName = data.FirstName,
                    LastName  = data.LastName,
                };

                facets.Add(PersonalInformation.DefaultFacetKey, personalInfo);
            }
        }