Event not being triggered

Event not being triggered

by Brandon Jimenez -
Number of replies: 3

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: -
In reply to Brandon Jimenez

Re: Event not being triggered

by Brandon Jimenez -

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

Attachment 2018-08-08_16-27-40.png
In reply to Brandon Jimenez

Re: Event not being triggered

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

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

In reply to Andreas Grabs

Re: Event not being triggered

by Brandon Jimenez -

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