cancel
Showing results for 
Search instead for 
Did you mean: 

event after customer registration

SOLVED
   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

event after customer registration

Hello,

 

trying to read post data after customer registration. This is my observer so far:

<?php

namespace Hoop\Util\Observer;

use Magento\Framework\Event\ObserverInterface;


class AfterCustomerRegistration implements ObserverInterface
{
    protected $request;

    public function __construct(\Magento\Framework\App\Request\Http $request
    )
    {
        $this->request = $request;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        var_dump($this->request->getPost());
        die('test');
    }
}

I get:

 

Fatal error: Uncaught TypeError: Argument 1 passed to Hoop\Util\Observer\AfterCustomerRegistration::__construct() must be an instance of Magento\Framework\App\Request\Http, instance of Magento\Framework\ObjectManager\ObjectManager given...

 

any suggestion?

thanks a lot

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: event after customer registration

Could you run below command and check,

php bin/magento setup:di:compile
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

View solution in original post

Re: event after customer registration

that made it, thanks a lot!

View solution in original post

5 REPLIES 5

Re: event after customer registration

You need to remove generated folder from root except .htaccess file.

Clear cache and check again.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: event after customer registration

hey Rakesh,

 

thanks for answering. After I did that, I get this in the exception.log:

 

main.CRITICAL: RuntimeException: Source class "" for "Magento\Framework\App\Response\Http\Interceptor" generation does not exist

 

any further suggestion?

thank you

Re: event after customer registration

I'm not sure I understand what you say...

this is my observer: app/code/Hoop/Util/Observer/AfterCustomerRegistration.php

did I answer?

Re: event after customer registration

Could you run below command and check,

php bin/magento setup:di:compile
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: event after customer registration

that made it, thanks a lot!