Skip to content

kkrieger85/Magento-Slack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento Slack Integration

Build Status Scrutinizer Code Quality

*Note: This module doesn't do much on it's own. It's just an api wrapper for integrations you write. You can use it chat to your Slack channel when: an order is placed, and exception is logged, an account is created, etc.

Config

image

  • In Slack: Create a bot under "Integrations" in the
  • In Magento: Under System > Config > Services > Slack, enable the module and add your token
  • Click Save
  • Click Get Channels to collect your channels and their identifiers

API Usage

Review the methods in Slack's API.

Invoke with:

Mage::getModel('slack/api_<method>')
	->setFooArg('bar')
	-><action>();

For instance:

$chat = Mage::getModel('slack/api_chat');

$chat->setChannel('general')
    ->setText('Hello World');

$chat->postMessage();

var_dump($chat->getData());

Notice you use the channel name, not it's identifier.

Mage::getModel('slack/api_files')
    ->setChannels(array('general', 'random'))
    ->setContent(file_get_contents($someFile))
    ->upload();

etc.

About

Magento wrapper for Slack API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 89.4%
  • HTML 10.6%