Get access to free tutorials, exclusive content and more.

Learn How To Create Slack Notifications From WordPress Form Submissions

If you’re like me, you don’t have time or the bandwidth to religiously check your email for WordPress form submission notifications. Nor should you. Email can even be unreliable, inconvenient, and even time-consuming.  Those who have 1000+ emails they haven’t deleted know what I’m talking about.

Instead, use Slack.  It is already a part of your daily workflow. You are addicted to it, it’s installed on pretty much every device you own, and most importantly you are going to be excited when you see that notification coming through, unlike your email. So put it to work!

Building Slack notifications from WordPress form submissions using our state-of-the-art drag-and-drop form builder is super easy.  Keep reading to find out how. 

Table of Contents

  1. Connecting Slack to Ninja Forms 
  2. How To Generate Slack Notifications From Your WordPress Form Submissions
  3. How To Conditionally Generate Slack Notifications From Your WordPress Form Submissions

1. Connect Slack to WordPress Forms

Before moving forward you will need to create a webhook via the Slack API. Followed by the installation of our Ninja Forms, Slack, and Conditional Logic ( optional ) add-on(s).   Believe it or not, these next two steps are the hardest steps of the entire process.

Retrieve the Slack Webhook

Create a New App by navigating to the api.slack.com. For detailed instructions on the app creation process see our documentation.  After you have successfully created your app click on the Incoming Webhooks menu option and enable the Activate Incoming Webhooks switch.  Copy the newly created Webhook URL to your clipboard. The webhook will be added to the Slack URL field in step 2.

Slack Webhook URL, Slack notifications from wordpress

Install the Slack Add-on

Install and activate the Conditional Logic ( optional ) and Slack add-on(s) like you would any regular WordPress plugin. Their installation is almost exactly the same. To install any add-on, first, download the add-on from your account page under the Downloads tab. Then, follow these steps:

  1. In your WordPress Dashboard go to Plugins > Add New.
  2. Choose the “Upload” option at the top of the page.
  3. Click “Choose File” and navigate to the “zip” file you downloaded from your account on NinjaForms.com
  4. Click “Install Now”
  5. After the installation finishes, click “Activate” and you will be ready to work with the add-on you purchased. Repeat this step for each add-on you have purchased.

Make sure your license keys are entered in your WordPress Dashboard under Ninja Forms -> Settings -> Licenses, or you will not receive automatic updates for your add-ons.  For more information refer to our Installation Guide

2. Generate Slack notifications from WordPress form submissions

Assuming you have already created a form, navigate to Email & Actions to add the Slack action. Otherwise, check out our building a form refresher.  To add the Slack action click the blue/circle + icon at the bottom right and select Slack.

Selecting the Slack action, Slack notifications from wordpress

Within the action paste your Slack webhook into the Slack URL field.

Slack Action setup, Slack notifications from wordpress

Customize the message with fields from your form using the merge tag picker.  Once the message is customized to your liking publish and test your form. You will know everything is working correctly if you receive a Slack notification or see the submission appear in your chosen workspace.

Slack App Robot, Slack notifications from wordpress

If you are not seeing the submission appear in Slack you will need to review your app and action settings.  For in-depth troubleshooting, reach out to our customer support team as they are always happy to help.  

3. Conditionally generate Slack notifications from WordPress form submissions

The process of creating a conditional slack notification from WordPress is very similar to the process laid out in How To Generate Slack Notifications From Your WordPress Form Submissions. However, this time, you are going to add a list field to your form, create multiple Slack actions, and create conditions for which the action will process.

Step 1: Create a Slack channels list for your WordPress form

To give your users a choice of what Slack channel they want their form submission to go create a field that allows them to choose one or more options from a set of predefined choices.   This can be achieved with a Select (dropdown ), Radio List, Checkbox List, or Multi-Select field.

Add the desired field to your form by clicking the blue/circle + icon at the bottom right. Drag-and-drop the field into place.  Add a label and value to each option that corresponds with the Slack channel you want their submission to be associated with.

WARNING: If you aren’t seeing a place to add values in your desired field make sure ‘Dev Mode’ has been enabled. Enabling this feature will give you access to advanced settings. To enable navigate to Ninja Forms > Settings > Advanced Settings > click ‘Dev Mode’.

Make sure you have added the values, not just labels to the options fields in your list.  Otherwise, you will experience mapping issues with Conditional Logic, so make sure those have been accounted for before you move on.

Slack Channel List, Slack notifications from wordpress

Step 2: Create a Slack Action for Each Slack Channel

Create a Slack action for each Slack channel, you wish to send your newly created Slack notification(s). Add the action by clicking the blue/+ icon at the bottom right of the Email & Actions screen. 

There is no limit to the number of actions you can have, so go wild.  Just keep in mind that excessive action use will SLOW your website down. For more tips and tricks check out, The Definitive Guide to Using Form Actions.

After you have added all the Slack actions that you think you will need, begin setting up each action with the following:

  • Message – Add values manually or with the use of merge tags
  • Slack URL – Webhook URL for Your Workspace/Channel

Multiple Slack actions

Step 3: Create Slack Webhook for each Slack action

See, Retrieve the Slack Webhook and complete the process for each action.  Once you have all the webhooks created for each channel, copy them into the Slack URL field.

Step 4: Add a Conditional Statement to Each Slack Action

Open the Conditional Logic dropdown found in the action.  This will help you determine which Slack channel you want the notification to go to.

Conditional Logic dropdown in Slack action

Open the first dropdown to choose your field. Extend the second dropdown to reveal the conditional statement ( Has Selected or Does Not Have Selected ). Expanding the third dropdown will auto-populate values from the field you selected. Pick the value and then repeat the process with your subsequent Slack actions. 

Conditional Logic Slack action setup

Creating lists based on the workspace/channels is just one of many ways in which you can conditionally set your Slack actions. Alternatively, you could send the Slack notification from WordPress to a specific workspace/channel based on a specific email address

For this, select the email field, select Equals, and input your desired email address. For reference check out Sending Conditional Email with Ninja Forms.

Ninja Forms and Slack: To Keep Things From Falling Between the Cracks.

Now that you know how to set up Slack notifications from WordPress form submissions I challenge you to give it a try. Life is challenging, but managing your WordPress website shouldn’t be.

Free yourself of the responsibility and worry of missing a submission and give Slack and Conditional Logic a try.  All of our add-ons come with a 14-day money-back guarantee so what do you have to lose?