How to Configure Wordpress Contact Form 7 and CF7 Webhooks for Basin

Here's a quick guide that shows you how to forward your Contact Form 7 submissions to Basin using the CF7 Webhooks plugin.

Contact Form 7 is a simple form builder for WordPress that makes it easy to setup and manage forms on your WordPress site. It does not come with persistent submissions storage, advanced spam features, email configurations, or many of the other Basin features. This is why it might make sense to use Basin. 

Getting Started

Before we get too far, let's make sure we have everything we need to make this work:
1. Install Contact Form 7
2. Install CF7 Webhooks
3. A Basin account

Once you've created your first form with Contact Form 7, you can navigate to the webhooks configuration tab by going Contact -> Contact Forms -> Click on the Form -> Webhook tab. Next, Go to your Basin dashboard and find your unique form endpoint.
image.png 77.56 KB

Enter your form endpoint into the Webhook URL field.
2022-07-07_17-15.png 121.91 KB

The next step is the trickiest. We need to preserve the submitting user's IP address so our spam filters do not think submissions are originating from a shared hosting provider or web server. This is a common source of spam abuse.

Next, we will need to go to our Basin dashboard and find our Account API Key. This can be found under the Avatar Menu in the top right -> My Account -> Basin API

image.png 76.54 KB

The following PHP snippet and your Basin Account API Key is needed for the next step.

 * CF7 Webhooks to Basin
 * Requires "Contact Form 7" and "CF7 Webhooks"

add_filter( 'ctz_post_request_args', 'discord_ctz_post_request_args' );

function discord_ctz_post_request_args( $args ) {
                $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
                $ip = $_SERVER['REMOTE_ADDR'];
        $args['headers']["Basin-True-Client-IP"] = $ip;
        $args['headers']["Origin"] = ""; // <- Your website here including the protocol 
        $args['headers']["Basin-API-Key"] = "Your Basin account API Key here";

    return $args;
We need to add the above code snippet to our theme functions.php file in Wordpress. To do this you click Appearance -> Theme File Editor -> functions.php. Then copy and paste the above code snippet into your functions file. Be sure to make sure to use your Basin Account API key. It's probably a good idea to make sure you are editing the right theme in the top right dropdown as
image.png 161.28 KB

And that's it! After you save your theme file, you are ready to start forwarding all your submissions to Basin. You can now enjoy secure submission storage, beautiful email templates, easy spam filtering, and many more great features.
If you need help with configuring this on your WordPress site, be sure to reach out to our support and we would love to help you out. 

Get Started with a Free Basin account today!

Discover the benefits of Basin and how it can help streamline your forms. Sign up now and explore our features.

Sign Up for Free