## General developer forum

### Event not being triggered

Event not being triggered

Hello fellow moodlers:

I'm trying to set up an event to send an email when the user updates but is not working, so i enabled the event monitoring plugin with a subscription to the update password event but i'm not getting an email. I also used the Even Trigger plugin but i got the same results...that is to say no results. I'm receiving emails from different events, so that's not the issue. Other than that, i'm open to any suggestions regarding on how to trigger the event.

Best Regards

Brandon

Average of ratings: -
Re: Event not being triggered

Addenda:

I forgot to mention that my Moodle is a 3.5.1 and Php 7.1. Attached is a screenshot of the event i'm subscribed to as an admin to monitor when a user updates their password, but alas is not working.

Regards

Average of ratings: -
Re: Event not being triggered

Hi Brandon,

the event is definitely fired:

File: lib/moodlelib.php

Function: update_internal_user_password()
around line: 4629

        // Trigger event.        $user =$DB->get_record('user', array('id' => $user->id)); \core\event\user_password_updated::create_from_user($user)->trigger();

Maybe you have a non core auth method, that doesn't use this function.

Best regards
Andreas

Average of ratings: -
Re: Event not being triggered

Hello Andreas:

Thanks for the pointers. Actually, all the users are created manually, so that definitively should be included in the trigger. Other than that, i'd have to rewrite the wheel, which seems a little redundant. Unless i'm approaching it the wrong way, because my idea is for the user to receive an email when the password is updated, hence Dan Mardsen's Event plugin, but now i'm back to just trying to receive it myself as an admin, both to no avail.

Anyway, thanks for the help, much appreciated.

Brandon

Average of ratings: -