I have created an event on my new custom module to display something after new newsletter subscriber have subscribe both nothing is showing. I reference this for event Here for both postdispatch and predispatch
The event.xml shown below
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_postdispatch_newsletter_manage_save">
<observer name="controller_action_dispatch_newsletter" instance="Company\Module\Observer\Update" />
</event>
</config>
This is the observer is shown below /observer/Update.php
<?php
namespace Company\Module\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class Update implements \Magento\Framework\Event\ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
echo "email";
exit; //un commet this to make sure event works
}
}
Thank You