A powerful integration between Intercom, Slack, and Notion that streamlines customer support workflow by automatically creating and managing support tickets.
- Create Notion tickets directly from Intercom conversations
- Automatic ticket deduplication using AI
- Automatic Slack channel creation and user synchronization
- Smart ticket title generation
- Automatic conversation summarization
- Status synchronization across all platforms
Before you begin, ensure you have:
-
Intercom Setup
- An Intercom workspace
- Admin access to create custom actions
- Intercom API access token
- App ID from your Intercom workspace
-
Slack Setup
- A Slack workspace
- Admin access to create channels
- Bot token with necessary permissions:
channels:managechat:writeusers:readusers:read.email
-
Notion Setup
- A Notion workspace
- Admin access to create databases
- Integration token with write access
- A database with the following properties:
- ID (Type: Unique ID, Prefix: "JMP")
- Title (Type: Title)
- Intercom Conversations (Type: URL)
- Slack Channel (Type: URL)
- Status (Type: Select)
-
Gemini Setup
- An Gemini API key
Create a .env file in the root directory with the following variables:
# Intercom
export INTERCOM_ACCESS_TOKEN="your_intercom_access_token"
export INTERCOM_APP_ID="your_intercom_app_id"
# Slack
export SLACK_BOT_TOKEN="your_slack_bot_token"
export SLACK_TEAM_ID="your_slack_team_id"
# Notion
export NOTION_API_KEY="your_notion_api_key"
export NOTION_DATABASE_ID="your_notion_database_id"
# Gemini
export GEMINI_API_KEY="your_gemini_api_key"-
Clone the repository:
git clone https://github.com/yourusername/inter_slack_notion.git cd inter_slack_notion -
Load environment variables:
source .env -
Install dependencies:
mix setup
-
Start the Phoenix server:
mix phx.server
The server will be available at localhost:4000.
- Go to your Intercom workspace settings
- Navigate to Custom Actions
- Create a new Custom Action:
- Name: "Create Notion Ticket"
- Target URL:
http://your-server/api/intercom/create-ticket - Method: POST
- Authentication: Add your chosen authentication header
- In Intercom, open any conversation
- Click the three-dot menu
- Select "Create Notion Ticket"
- The system will:
- Check for existing similar tickets
- Create a new ticket or update an existing one
- Create/update Slack channels
- Sync participants across platforms
- Run tests:
mix test - Run linter:
mix credo - Generate docs:
mix docs
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
-
Install the Fly CLI:
# On macOS brew install flyctl # On Linux curl -L https://fly.io/install.sh | sh
-
Login to Fly:
flyctl auth login
-
Clone and prepare the repository:
git clone https://github.com/yourusername/inter_slack_notion.git cd inter_slack_notion -
Launch the app (this creates the app but doesn't deploy):
flyctl launch --no-deploy
This will:
- Create a new app on Fly.io
- Generate a
fly.tomlconfiguration file - Set up necessary resources
-
Set up environment variables in Fly:
flyctl secrets set \ INTERCOM_ACCESS_TOKEN=$INTERCOM_ACCESS_TOKEN \ INTERCOM_APP_ID=$INTERCOM_APP_ID \ SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN \ SLACK_TEAM_ID=$SLACK_TEAM_ID \ NOTION_API_KEY=$NOTION_API_KEY \ NOTION_DATABASE_ID=$NOTION_DATABASE_ID \ GEMINI_API_KEY=$GEMINI_API_KEY
-
Deploy the app:
flyctl deploy --ha=false
-
Check the deployment status:
flyctl status
-
View the app logs:
flyctl logs
-
Get your app's URL:
flyctl apps open
-
Update your Intercom webhook URL to point to your new deployment:
- Go to your Intercom workspace settings
- Navigate to Custom Actions
- Update the "Create Notion Ticket" action URL to:
https://your-app-name.fly.dev/api/intercom/create-ticket
-
If the app fails to start, check the logs:
flyctl logs
-
To check resource usage:
flyctl status
-
To restart the app:
flyctl restart
-
To check environment variables:
flyctl secrets list
This project is licensed under the MIT License - see the LICENSE file for details.