public async Task <IActionResult> AddSubscriber(AddSubscriberRequest request) { LogMethod(Request.Body); await notificationApiClient.AddSubscriber(request); return(Ok()); }
public void AddSubscriber(AddSubscriberRequest request) { repository.Add(new SubscriberEntity { ExternalId = Guid.NewGuid(), Auth = request.Keys.Auth, Endpoint = request.Endpoint, ExpirationTime = request.ExpirationTime, P256Dh = request.Keys.P256Dh }); }
public void New_Subscriber_Is_Added() { MailChimpClient client = new MailChimpClient(Constants.ApiKey); var request = new AddSubscriberRequest(Constants.ListId); request.EmailAddress = "*****@*****.**"; request.Status = SubscriberStatus.Subscribed; request.MergeFields = new Dictionary <string, object>() { { "subscribe", "GET FREE PDF" }, { "JARBOO_PLA", "GetPdfEbook" } }; var response = client.Subscribers.Post(request); Assert.IsNotNull(response); Assert.IsNotNull(response.Result); }
public void Subscribe(Subscriber subscriber) { var addSubscriberRequest = new AddSubscriberRequest(listId); addSubscriberRequest.EmailAddress = subscriber.Email; addSubscriberRequest.Status = SubscriberStatus.Subscribed; addSubscriberRequest.MergeFields = new Dictionary <string, object>() { { JARBOO_PLA, subscriber.JarbooPlacement } }; try { _mailChimpClient.Subscribers.Post(addSubscriberRequest); } catch (Exception ex) { Logger.Error(ex); } }
public IActionResult AddSubscriber(AddSubscriberRequest request) { LogMethod(Request.Body); notificationLogic.AddSubscriber(request); return(Ok()); }
public async Task AddSubscriber(AddSubscriberRequest request) { var address = configuration.NotificationApiAddress + "AddSubscriber"; await HttpClientHelper.PostAsync <AddSubscriberRequest, object>(request, address); }