Drupal 8

Drupal 8 WorkBench EventSubscriber Example

Drupal 8 Event subscriber example for work bench moderation module.
say you want to do some thing when a work bench state changes ... this will get the logged in user vs the node content creator and get there enmails etc.

Service File:

services:
  test_even_subscriber.default:
    class: Drupal\test_even_subscriber\EventSubscriber\DefaultSubscriber
    arguments: ['@current_user']
    tags:
      - { name: event_subscriber }


Drupal\test_even_subscriber\EventSubscriber\DefaultSubscriber.php