Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ijjk/slack-contact-form
Example Next.js application that integrates with Slack to receive contact form submissions
https://github.com/ijjk/slack-contact-form
api nextjs now react slack
Last synced: 4 days ago
JSON representation
Example Next.js application that integrates with Slack to receive contact form submissions
- Host: GitHub
- URL: https://github.com/ijjk/slack-contact-form
- Owner: ijjk
- License: mit
- Created: 2019-08-11T16:31:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T12:33:00.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T13:42:16.783Z (about 1 month ago)
- Topics: api, nextjs, now, react, slack
- Language: JavaScript
- Homepage: https://slack-contact-form.jj4.now.sh
- Size: 1.5 MB
- Stars: 3
- Watchers: 2
- Forks: 6
- Open Issues: 16
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Slack Contact Form Demo
Shows example contact form that sends messages to a Slack channel
## Getting Started
1. Clone this app `git clone [email protected]:ijjk/slack-contact-form.git`
2. Install dependencies `cd slack-contact-form; yarn`
3. Start next exposing `SLACK_TOKEN` and `CHANNEL_ID`, `SLACK_TOKEN='TOKEN' CHANNEL_ID='id' yarn next`## Deploying
1. Add secrets to `now` with `now secrets add slack-token 'TOKEN'` and `now secrets add slack-channel-id 'id'`
2. Deploy it by running `now` in the project's root
3. Enjoy## Getting channel id
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'`
## Potential improvements
- 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