Beispiel #1
0
        public void Subscribe(SubscribeContactMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            _subscribeContactService.HandleContactSubscription(message.RecipientListId, message.ContactIdentifier, message.ManagerRootId, message.ContextLanguage, message.SendSubscriptionConfirmation);
        }
Beispiel #2
0
        private void SubscribeContact(ManagerRoot managerRoot, Guid listId, ContactIdentifier contactIdentifier, List <MarketingPreference> marketingPreferences)
        {
            if (_useDoubleOptIn)
            {
                // If DoubleOptIn should be used the contact is subscribed to the selected contact list and gets a confirmation mail
                // The contact is only subscribed to the global contact list, which is used as source for the segmented lists, if he confirms the link in the mail
                var message = new SubscribeContactMessage
                {
                    RecipientListId              = listId,
                    ContactIdentifier            = contactIdentifier,
                    ManagerRootId                = managerRoot.Id,
                    SendSubscriptionConfirmation = true,
                    ContextLanguage              = Language.Current
                };
                _exmSubscriptionClientApiService.Subscribe(message);
            }

            var contact = GetXConnectContactByIdentifer(contactIdentifier);

            _marketingPreferenceService.SavePreferences(contact, marketingPreferences);
        }
Beispiel #3
0
 public void Subscribe(SubscribeContactMessage message)
 {
     Condition.Requires(message, nameof(message)).IsNotNull();
     _subscribeContactMessagesBus.Send(message, null);
     _logger.LogDebug(FormattableString.Invariant(FormattableStringFactory.Create("[BUS] Queued subscribe contact message. . ManagerRootId '{0}', RecipientListId '{1}', ContactIdentifier '{2}'.", message.ManagerRootId, message.RecipientListId, message.ContactIdentifier?.Identifier)));
 }