Giter VIP home page Giter VIP logo

slack-contentful's Introduction

Slack Contentful Slack Icon Contentful Icon

GitHub tag Travis branch devDendencies Status

This Slack bot will allow users to set up notifications "on published" changes to specified Contentful entries and assets to a designated Slack channel.

Example Update

Requirements

Automated Set Up w/ Heroku

Allow for incoming hooks to your team's Slack

Add to Slack

Deploy the server to your own Heroku instance, and set SLACK_WEBHOOK to the incoming hook url from the integration above

Deploy

It's preferred to set your locale, and leave your bot's emojis and username blank as these can be edit through the "Incoming Hooks" page by other team members.

Manual Set Up

Configuration

The configuration of the bot are set with environment variables using an .env file. Please look at the example.env file of possible configurations, and create an updated .env file before you deploy.

Available Configuration Options:

ENV Variable Required Description Default Value
SLACK_WEBHOOK Y The webhook Url provided by the incoming hooks N/A
SLACK_CHANNEL Y The slack channel to send notifications N/A
ENTRIES Y A comma seperated list of Contentful Entry IDs you want to be notified of N/A
LOCALE N (but preferred) Contentful Locale to be tracked, currently only supports up to 1 en-US
PORT N The port for the node server to run on 5000
UPDATE_COLOR N Hex color for updates posted #27ae60
BOT_USERNAME N The bot's username ContentfulUpdates
BOT_EMOJI N The bot's icon pencil2
LARGE_PREVIEW N Should a large image preview be used for an asset notification false

Here's an example, of how your .env would look like. .env

SLACK_WEBHOOK = https://hooks.slack.com/services/TA123ka9/A123910a9d8/mkas929199sad83lmk7h
SLACK_CHANNEL = #ContentfulFeed
ENTRIES = 6OFbybzxM4WOCuIO4qo8Qs,6aFz3qcuPe0eA8kwQm0Ume,6a232jal2eA8kwQm0Ume,etc
LOCALE = en-UK
PORT = 5000
UPDATE_COLOR = #27ae60
BOT_USERNAME = ContentfulUpdates
BOT_EMOJI = bomb
LARGE_PREVIEW = true

Deploying Steps

  1. Set up the address of your server to configure where Contentful outgoing hooks should be sent to. (ex: myapp.heroku.com, botcontentful.mycompany.com)
  2. Clone or download/unzip this repo to your serer
  3. Adjust your .env file as outlined above
  4. Install Node.js on your server if not done so already
  5. Install repo dependencies
$ cd to/repo
$ npm install
  1. Start the server
$ npm start

Contentful Configuration

  1. Go to Contentful.
  2. Login with your credentials.
  3. Locate the cog icon labeled settings, and click on 'webhooks'.
  4. Hit 'New Webhook', and enter your server address in the URL bar.
  5. Click 'Create Webhook'.

Post Deployment - Test & Debugging

After your app has deployed, go to your server url and go to the /check endpoint to verify your settings, and help with debugging any potential issues.

Example:

http://myherokuapp.heroku.com/check

If you've successfully deployed, you should get a successful message stating Successful Set-up along with a table of configurations to verify against as depicted below.

successful set up

If set up was unsuccessful, you should get a message to verify your configurations, along with important configurations that the server has set up.

unsuccessful set up

Contribute

If you would like to contribute to this project, take a look at the wiki to get started.

Feel free fork and submit PRs, if applicable reference the issue, or explain the intent of the PR. If it's suitable, I'll go ahead and merge it.

slack-contentful's People

Contributors

brh55 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.