after registeration hook

majid1f

Active Member
MailWizz 2.0 Tester
dose MW have after registration hook? i know i can use customer_model_customer_aftersave hook after save method but i need after customer_company save or another hook that call after registration complete.
Thanks in advance for you help
 
hi,
i checked it earlier but it dose not have any related hook. i also checked the source code and i did not see any related hook in the

Code:
apps/customer/controllers/GuestController.php >> actionRegister()

method. and it dose not have any hook after registration complete
 
@majid1f
i know i can use customer_model_customer_aftersave hook after save method
but i need after customer_company save
Why not use "customer_model_customercompany_aftersave" ?
It triggers right after the comany info has been saved and you get access to the customer object as well:
Code:
Yii::app()->hooks->addAction('customer_model_customercompany_aftersave', function($company){
      if (Yii::app()->getController()->getRoute() != 'guest/register') {
            return;
      }
      $customer = $company->customer;
      // use the objects here...
});
 
Thanks @twisted1919 for your help.
I prepare a simple extension and I want to publish it as open-source.
I think and have investigated why some new customers just register and won't continue in our service.
I asked some of them and they reply that they have confused about how to continue and in what step they should create the list.
so I think about it and find a solution to this issue.
my solution was that when the customer register we should create a default list with his email address in it. so in this scenario customer can find out how to continue.
------------------------------------------------------------------------------------------------------
i will be happy to take a look at this extension and help me to find out bugs and ...
https://gitlab.com/masihfathi/ui-ux-improvment

or if you have other opinion i will be happy to hear.
------------------------------------------------------------------------------------------------------
 
Last edited:
I see, in this case the above hook will help since you can create the list. You can even create the list right after the customer is created, because after all, if the customer then does not confirm and it is removed from the app, the list will be removed at the same time.
i will be happy to take a look at this extension and help me to find out bugs and ...
https://gitlab.com/masihfathi/ui-ux-improvment

or if you have other opinion i will be happy to hear.
This is good. Instead of string literals like yes / no, use the class contants like: Classname::TEXT_YES and Classname::TEXT_NO:
Code:
$list->visibility = Lists::VISIBILITY_PUBLIC;
$list->merged = Lists::TEXT_NO;
$list->welcome_email = Lists::TEXT_NO;
$list->removable = Lists::TEXT_YES;
$list->subscriber_require_approval = Lists::TEXT_NO;
 
Back
Top