1

I'm trying to add an action after user signup so that we can post the clients external system so we can retrieve a customer number that we require. My question is does EVENT_BEFORE_VERIFY_EMAIL run as soon as the user signs up or is their another method of achieving this.

2

You could use the EVENT_AFTER_SAVE event to handle this, if you don't need the external call to be made before the user has verified their email.

Something like this:

Event::on(
    User::class,
    User::EVENT_AFTER_SAVE,
    function(ModelEvent $event) {
        /** @var User $user */
        $user = $event->sender;

        // If this is a new user
        if ($event->isNew) {
            // Call external system here
        }
    }
);
1
  • Thank you that's exactly what I was looking for since account verification won't be needed for the store but we still need to create a new customer on their internal system.
    – spence
    Dec 1 '20 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.