I am working on a Magento 2 extension that will send a message to me when a new product review is written. I've tried to create an observer, but it never seems to work.
In ets/events.xml, I have this:
<event name="review_save_after">
<observer
name = "jeroen_update_product_review"
instance = "Jeroen\ReviewIntegration\Observer\ProductReview" />
</event>
In Jeroen\ReviewIntegration\Observer\ProductReview:
namespace Jeroen\ReviewIntegration\Observer;
use Magento\Framework\Event\ObserverInterface;
class ProductReview implements ObserverInterface
{
protected $_storeManager;
protected $_request;
public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\App\Request\Http $request
) {
$this->_storeManager = $storeManager;
$this->_request = $request;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
return 'test';
}
}
This always gives a a blank page after a new review is written (and after the status of the review is updated). Can anyone find out what I am doing wrong?