How can you remove another modules events? So, I have an event subscriber for Drupal commerce that listens for "commerce_order.place.post_transition" and will send a bespoke order email (due to not being able to change some of the things like subject title in the commerce module).

Commerce also has an event subscriber listening to "commerce_order.place.post_transition" which will send an order receipt email. I need to unsubscribe this event to prevent sending duplicate emails but searching through google and comments sections of articles has lead me to a dead end.

Any ideas?
Remove the event subcriber service from the container:

my_module/src/MyModuleServiceProvider.php

namespace Drupal\my_module;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

/**
 * Remove the foo event subscriber.
 */
class MyModuleServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    $container-&gt;removeDefinition('foo_event_subscriber'); 
  }

}


You find the service name in the MODULE.services.yml file of the other module.

More info https://www.drupal.org/docs/8/api/services-and-dependency-injection/altering-existing-services-providing-dynamic-services