Announcement

Collapse
No announcement yet.

Query after adding user

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Query after adding user

    Hi! I need to execute some PHP after registration of any user. How i can realise that?

  • #2
    So, there are no ways for it?

    Comment


    • #3
      Guys, i really need this. My task is executing PHP script after successful adding of new user.

      Comment


      • #4
        You can use "afterSave" hook for User entity, examples please find at application/Espo/Hooks/
        Job Offers and Requests

        Comment


        • #5
          Thanks! All works fine. For people who need same thing:
          1. Create file: your_site/application/Espo/Hooks/User/User.php;
          2. Put this code:
          <?php
          namespace Espo\Hooks\User;
          use Espo\ORM\Entity;
          class User extends \Espo\Core\Hooks\Base
          {
          public function afterSave(Entity $entity) //After save USER entity
          {
          if ($entity->isNew()) //If entity is new (just created)
          {
          HERE php CODE FOR YOUR NEEDS
          }
          }
          }
          ?>

          Comment

          Working...
          X