PHP code example of magify / magento2-module-slacknotifier

1. Go to this page and download the library: Download magify/magento2-module-slacknotifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

magify / magento2-module-slacknotifier example snippets


    

    namespace YourVendorName\SlackNotifier\Controller\Index;

    use Magento\Framework\App\Action\Action;
    use Magento\Framework\App\Action\Context;
    use YourVendorName\SlackNotifier\Model\CustomMessage;

    class Test extends Action
    {
        protected $customMessage;

        public function __construct(Context $context, CustomMessage $customMessage)
        {
            $this->customMessage = $customMessage;
            parent::__construct($context);
        }

        public function execute()
        {
            $title= "This is a test title";
            $message = "This is a test message";
            $async = false; // or true based on your 
bash
    php bin/magento module:enable Magify_SlackNotifier
    
bash
    php bin/magento setup:upgrade