1 min read
Slack recipe
Two ways: native Slack integration (no code), or a generic webhook to a Slack incoming-webhook URL.
Option A — Native Slack integration
- Open the form's Webhooks page.
- Click Add integration → Slack.
- Authorize Formspring to post to a channel.
We render submissions in a clean Slack-native format (form name + key fields highlighted, "View in dashboard" button).
Option B — Generic webhook to a Slack incoming webhook
- In Slack, Apps → Incoming webhooks → Add to Slack. Pick the channel. Copy the webhook URL.
- In Formspring, Webhooks → Add webhook. Paste the URL. Save the signing secret.
- Run a small handler somewhere (Cloudflare Worker, Lambda, etc.) that:
- Verifies the Formspring signature.
- Reformats the submission into Slack's blocks API.
- POSTs to the Slack URL.
export default async function handler(req) {
// 1. Verify signature (see Signing docs)
// 2. Build a Slack message
const body = await req.json();
const text = Object.entries(body.payload)
.map(([k, v]) => `*${k}:* ${v}`)
.join('\n');
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: `New submission to *${body.form_id}*\n${text}` }),
});
return new Response('', { status: 200 });
}