@Ajit
I've been checking for that hook and found it in login.php, so code should be very simple.
Placing above code to index.php of any installed plugin will work, at least for me:
// NOTIFY SITE OWNER ABOUT ADMIN LOGIN TO OSCLASS
function notify_admin_has_logged($admin) {
$text = sprintf('There was new login to oc-admin area of your site, admin logged in: %s (%s) at %s from ip %s', $admin['s_name'], $admin['s_email'], date('Y-m-d H:i:s'), ($_SERVER['HTTP_CLIENT_IP'] ? : ($_SERVER['HTTP_X_FORWARDED_FOR'] ? : $_SERVER['REMOTE_ADDR'])));
if($admin['s_username'] <> 'admin5') { // word 'admin5' can be changed to any name you want to not receive notifications
mail(osc_contact_email() , 'New admin login', $text);
}
}
osc_add_hook('login_admin', 'notify_admin_has_logged', 9);
Outcome is getting raw email to site owner about admin login in form:
"There was new login to oc-admin area of your site, admin logged in: demo (demo@demo.com) at 2020-03-06 08:22:11 from ip 192.168.1.1"