Send website form submissions to Slack without a backend

5 min read

To send website form submissions to Slack without a backend, point your form's action at a SagePigeon endpoint and give SagePigeon a Slack incoming webhook URL. Each submission is then stored, emailed to whoever should answer it, and posted into the channel with every answer labelled. Slack is on SagePigeon's Free plan, and the whole set-up takes about 10 minutes, most of it in Slack's settings.

What you need

  • A form on your site whose action address you can change. Plain HTML, a static site generator or a builder that lets you set a custom form action all work.
  • A Slack workspace where you can add an app to a channel.
  • A SagePigeon workspace. The Free plan is enough.

Step 1: point your form at SagePigeon

In SagePigeon, go to Forms, press New form, pick a starting point such as Blank form, name it, type the address that should get the email into Notify these addresses, and press Create form. The form's Setup tab shows a snippet with your endpoint already in it:

HTML
<form action="https://api.example.com/f/FORM_ID" method="POST">
  <input name="name" placeholder="Name" required />
  <input name="email" type="email" placeholder="Email" required />
  <textarea name="message"></textarea>
  <input name="_gotcha" type="text" tabindex="-1" hidden autocomplete="off" />
  <button type="submit">Send</button>
</form>

If you already have a form, you only need two changes: the action and the hidden _gotcha field. That field is a spam trap. People never see it, bots fill it in, and SagePigeon files anything that arrives with it filled as spam.

While you are in the form's settings, set Redirect after submit (under Settings → Delivery) to your thank-you page. Without it, a visitor who submits a plain HTML form lands on a short SagePigeon page that says "Sent. Thank you." instead of on your site.

Step 2: create a Slack incoming webhook

Slack gives each channel connection its own URL. In Slack's app settings, create an app for your workspace (or use one you already have), turn on Incoming Webhooks, and add a new webhook to the channel you want, for example #leads. Copy the URL. It starts with https://hooks.slack.com/services/.

Treat that URL like a password. Anyone who has it can post into the channel.

Step 3: add Slack as a destination

Back in SagePigeon, open the form and go to Settings, then Integrations.

  1. Under Chat destinations, press Add a destination.
  2. Leave the type on Slack and paste the webhook URL.
  3. Keep on ticked.
  4. Press Save integrations.

If the form has unpublished changes, the save goes into the draft, and Slack starts receiving once you publish it from the bar at the top of the page.

Step 4: send a test submission

Go to the Setup tab and press Send a test submission. SagePigeon posts a sample to your endpoint exactly as your site would, then shows you each stage: stored, notification sent, and waiting for a reply. The Slack message should appear in the channel within a few seconds.

If nothing shows up in Slack, open the submission in the Inbox. Its delivery log lists the Slack post with the status Slack returned, which usually points at a mistyped or revoked webhook URL. After you fix the URL, send another test instead of waiting on the retries, which run for about half an hour.

What the message looks like in Slack

For a form called "Website contact form", the post reads:

Example
New submission: Website contact form

Name                      Email
Priya Raman               priya@example.com

Message
Could you cater a weekday lunch for 40 people in March?

[ Open in SagePigeon ]

The header carries the form's name, so a single #leads channel can take every form on your site. Answers are laid out in two columns with bold labels made from your field names: phone_number turns into "Phone number". Slack messages have room for 10 fields, so a long form shows its first 10, and any answer over 200 characters is cut short with "…". The button opens the full submission in SagePigeon.

Why not post to Slack straight from the browser

You could paste the Slack webhook URL into a few lines of JavaScript on your contact page. Please don't. The URL would sit in your page source, and anyone who reads it can post whatever they like into your channel, as often as they like. You would also get no spam filtering, no rate limit, and no copy of the message if Slack drops it.

A small serverless function fixes the secrecy problem, and it is a fine choice if you enjoy maintaining one. You will then own the honeypot, the rate limiting and the email notification too. With SagePigeon those come with the endpoint.

Slack is the alert, and the record lives somewhere else

A Slack ping tells the right people fast. It is poor at telling you whether anybody answered. Messages scroll away, a thumbs-up reaction does not mean a reply went out, and on Monday nobody remembers who said they would handle Saturday's enquiry.

That is why the button in each message opens the request in SagePigeon. In SagePigeon's Inbox the request sits on a clock that keeps running until someone on your team replies. You can Take it on so the rest of the team sees it is yours, or reply from the Inbox and the clock stops. If a request waits more than a day, SagePigeon emails the workspace's owners and admins a list of everything still waiting.

We wrote more about that in Contact form leads lost in a shared inbox.

Things that trip people up

  • http addresses are refused. Slack webhook URLs are https, and SagePigeon will not post to anything that resolves to a private network.
  • Spam does not reach Slack. Submissions caught by the honeypot wait in the Spam list for seven days, where you can release a real one.
  • One channel per destination. To post to #leads and #sales, add two destinations. A form can have up to 10.
  • Teams, Discord and the rest. The same panel offers Teams, Discord, Google Chat, Mattermost, Telegram and a raw webhook on Pro and Scale. On Free they are marked "paid".

The Slack integration page has the full payload SagePigeon sends, if you are building on top of it, and the docs cover posting JSON for forms that submit with JavaScript.

Questions people ask

Is the Slack integration free?

Yes. Slack is included on SagePigeon's Free plan, which covers 500 submissions a month and 3 forms with no card. Teams, Discord, Google Chat, Mattermost and Telegram need Pro or Scale.

Can one form post to two Slack channels?

Yes. Add a second destination with the other channel's incoming webhook URL. A form can have up to 10 destinations.

What happens to a submission if Slack is down?

The submission is stored before anything is sent, and the email notification goes separately. SagePigeon tries a failed Slack post again after 30 seconds, 2 minutes, 10 minutes and 15 minutes, and writes each attempt to that submission's delivery log with the status Slack returned.

Do I have to change how my form looks?

No. Only the form's action address changes, plus one hidden field for spam. Your markup and styles stay as they are.

Start on the Free plan.

Create a workspace, make a form, paste your Slack webhook URL and send a test. No card, and 500 submissions a month.