Shows example contact form that sends messages to a Slack channel
- Clone this app
git clone git@github.com:ijjk/slack-contact-form.git
- Install dependencies
cd slack-contact-form; yarn
- Start next exposing
SLACK_TOKEN
andCHANNEL_ID
,SLACK_TOKEN='TOKEN' CHANNEL_ID='id' yarn next
- Add secrets to
now
withnow secrets add slack-token 'TOKEN'
andnow secrets add slack-channel-id 'id'
- Deploy it by running
now
in the project's root - Enjoy
You can get find the channel id using the conversations.list
Slack API endpoint.
Example: curl https://ijjk.slack.com/api/conversations.list --form token='SLACK_TOKEN'
- Add emoji previewing in the form to allow seeing Slack emojis in the textarea
- Add spam prevention by storing hash of sender's IP in the message and looking up the messages for previous messages sent with the IP's hash