<?php
add_action('peepso_action_profile_completeness_change', 'hook', 10, 1);
/*
* Send an email to admin when someone reaches 100%
*/
hook($args) {
if(100 == $args['after']) {
$PeepSoUser = PeepSoUser::get_instance();
$subject = "{$PeepSoUser->get_fullname() is now at 100% profile";
$message = "Hi,\n\n this email is just to let you {$PeepSoUser->get_fullname()} reached 100% profile completeness.\n\nHave a nice day!";
mail('admin@example.com', $subject ,$message);
}
}