Change record status: 
Project: 
Introduced in branch: 
main
Introduced in version: 
TBD
Description: 

New ContentModerationStateChangedEvent event has been added, which provides the ability to react to the state change on the moderated content entity.

Code example

final class ContentModerationStateChangedSubscriber implements EventSubscriberInterface {

  public function onModerationStateChange(ContentModerationStateChangedEvent $event): void {
    // Report, log or send an email.
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents(): array {
    return [
      ContentModerationEvents::STATE_CHANGED => ['onModerationStateChange'],
    ];
  }

}
Impacts: 
Module developers