コード例 #1
0
    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);
    }
コード例 #2
0
    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);
    }