public string SubscribeToActiveCompaign(string email, string serviceType) { string response = ""; ActiveCampaignConnectorService connection = new ActiveCampaignConnectorService("yourApiUrl", "ApiKey"); bool testConnection = connection.TestConnection(); if (testConnection) { ActiveCampaign.Services.ContactService cs = new ActiveCampaign.Services.ContactService(connection); response = cs.Subscribe(email, serviceType); } else { response = "Unable to connect to Api"; } return(response); }
public string AddContactToActiveCompaign(string firstName, string lastName, string email, string serviceType) { string response = ""; ActiveCampaignConnectorService connection = new ActiveCampaignConnectorService("yourApiUrl", "ApiKey"); bool testConnection = connection.TestConnection(); if (testConnection) { ActiveCampaign.Services.ContactService cs = new ActiveCampaign.Services.ContactService(connection); response = cs.AddNewContact(firstName, lastName, email, serviceType); } else { response = "Unable to connect to Api"; } return(response); }