示例#1
0
        public string AddSubscriber(CampaignUser user, bool resubscribe = false)
        {
            Subscriber subscriber = new Subscriber(_auth, _listId);
            string     result     = string.Empty;

            try
            {
                string newSubscriberID = subscriber
                                         .Add(user.Email, user.Name, null, resubscribe, ConsentToTrack.Unchanged);
                result = newSubscriberID;
            }
            catch (CreatesendException ex)
            {
                ErrorResult error = (ErrorResult)ex.Data["ErrorResult"];
                throw new ApplicationException(error.Code + " " + error.Message);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.ToString());
            }
            return(result);
        }
示例#2
0
        public void DeleteSubscriber(CampaignUser user)
        {
            Subscriber subscriber = new Subscriber(_auth, _listId);

            subscriber.Delete(user.Email);
        }