How to Send a Message to a Slack Channel from a WordPress Form?

Table of Contents

Want real-time alerts in Slack whenever someone submits your WordPress form? By connecting your form to a Slack channel, you can instantly notify your team, track leads, or manage support requests without missing a beat. 

With the Form block from Nexter Blocks, you can easily connect a Slack channel to your WordPress form.

To check the complete feature overview documentation of the Nexter Blocks Form block, click here.

Requirement  – This block is a part of the Nexter Blocks, make sure it’s installed & activated to enjoy all its powers.

For this, you must have a Slack User OAuth Token and a Channel Name.

Get a Slack User OAuth Token

Create an account in Slack if you don’t already have one. Once you are logged into your account, follow the steps – 

Note: You must have a workspace in your Slack account; if not, then create a workspace in Slack.

1. Go to the Slack API.

2. Click on Your apps in the top menu.

slack oauth 1

3. On the next page, click on the Create an App button.

slack oauth 2

4. It will open a pop-up; click on From scratch.

slack oauth 3



5. In the next screen, add your app name.

6. Then select the appropriate workspace and click on the Create App button.

slack oauth 4

7. In the Settings page, click on OAuth & Permissions from the left sidebar.

slack oauth 5


8. In the OAuth & Permissions page, scroll down to the Scopes section. In the User Token Scopes section, add the necessary scopes. For example, to read messages, add channels: history; to post messages, add chat: write.


slack oauth 6

9. Then scroll up to the page and click on the Install to (Your Workspace Name) button.

slack oauth 7

10. If you are the admin of the workspace, then just click on the Allow button, and your app will be installed.

slack oauth 8

On the next screen, you’ll see your User OAuth Token; copy it into a notepad.

slack oauth 9

Find a Slack Channel Name

In your Slack app, all the names under the Channel dropdown are channel names. A Slack channel name starts with #, so copy the channel name where you want to send the messages.

slack channel name 1

Use the Form Block

Now, add the Form block to the page and select the appropriate form type, then follow the steps –

1. Add the required form fields and customize them as per your requirements.

2. Then select the main form block and go to the Action After Submit tab and select Slack from the Options dropdown.

3. Now you’ll see the Slack tab, open it.

4. Then add your User OAuth Token and the channel name where you want to send the message in the User OAuth Token and Channel Name fields.

Note: Make sure to add the channel name with # in front.

form action after submit slack

Now, when a user fills out your form, it will add a message in your selected Slack channel.

Still in Doubt? Let’s Assist You

Need Help? Ask AI Bot

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Docs

icon
icon
icon
icon
icon