Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save max-kk/0c777ec20fb3c95942c3b707cf937e92 to your computer and use it in GitHub Desktop.
Save max-kk/0c777ec20fb3c95942c3b707cf937e92 to your computer and use it in GitHub Desktop.
LRM after_register_action
jQuery(document).on('lrm_user_logged_in', function(response, $form, action) {
if ( "register"=== action && response.data.user_id ) {
setTimeout(function() {
$('.lrm-user-modal').click();
}, 5000); // 5 sec
}
});
// IF the user is registered but not logged in (have to enter pass or verify account)
jQuery(document).on('lrm/ajax_response', function(event, response, $form, action) {
if ( "registration" === action && "register_new_user" === response.data.from && response.data.message.indexOf("Your account is still pending approval") > 0 ) {
location.href = "URL";
}
});
jQuery(document).on('lrm_user_logged_in', function(response, $form, action) {
if ( "register"=== action && response.data.user_id && $(".um-153").length > 0 ) {
// $(".um-153").length > 0 is optionally to check if your form is loaded on the page, like
// DO your ACTION like
my_send_teacher_msg(response.data.user_id);
}
});
jQuery(document).on('lrm_user_logged_in', function(response, $form, action) {
if ( "register"=== action && response.data.user_id ) {
// https://developers.google.com/analytics/devguides/collection/analyticsjs/events
ga('send', 'event', 'user', 'register', "User registration");
}
});
// IF the user is registered but not logged in (have to enter pass or verify account)
jQuery(document).on('lrm/ajax_response', function(event, response, $form, action) {
if ( "registration"=== action && response.data.user_id ) {
setTimeout(function() {
jQuery('.lrm-user-modal').click();
}, 5000); // 5 sec
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment