Webhook after user registration

@Dinaras - you can hook into the registration process when a new customer registers. In apps/ini-custom.php you can add something like:
PHP:
<?php
    
    hooks()->addAction('customer_model_customer_aftersave', function(Customer $model) {
        if ($customer->scenario != 'register') {
            return;
        }
        // do whatever with $customer, like send the data to a url.
    });
 
Hello, i am not really a php developer but i can give this a try. Can you tell me what values the $customer variable holds?
Thank you
 
Can you tell me what values the $customer variable holds?
Sure, it is all the info related to the current customer that has just registered.
PHP:
$customer->email; // will give you the email,
$customer->first_name; // first name
$customer->last_name; // last name
$customer->status; // status
If you open apps/common/models/Customer.php at the start of the file you'll see all these properties you have access to.
 
Back
Top