User_Login_Track
We going to monitor when an user logged in, then check if they have any course enrollment, we schedule a hook to notify them via the queue table.
Description #
Class User_Login_Track
Source #
File: includes/notifications/src/trigger/user-login-track.php
Methods #
- can_send_delayed_email — This one have no delay
- get_last_activity — Get the last activity of an user, in greedy way.
- get_users_and_courses — Return an array which contains the users => the courses they enrolled.
- get_users_ids_from_course — Return an array of users ids from the course provided.
- listen — A base point for monitoring the events
- maybe_send_reminder — Loop through all the course and find all users enrolled, then check for how long they did not logged in
- track_logged_time — Store the last time the user logged in.