GPAI Portal Plugin
Action hook
gpai_on_approval – Trigger upon approval button is clicked via email
add_action('gpai_on_approval',function( $user_id ) {
// do stuff here
}, 10, 1 );
gpai_on_rejection – Trigger upon reject button is clicked via email
add_action('gpai_on_rejection',function( $user_id ) {
// do stuff here
}, 10, 1 );
gpai_sp_report_sent – After SP Report has been sent to SP and Portal Admin
add_action('gpai_sp_report_sent',function( $sp_email_address, $report_data ) {
// do stuff here
}, 10, 2 );
Filters
Here are filter(s) you can use to modify some of the data.
spmind_report_in_email – This is the SPMIND report that is attached to the email to portal admin.
remove_filter('spmind_report_in_email', 'khalim_spmind_email_report'); // Remove existing from the filter
add_filter('spmind_report_in_email','spmind_report_table');
function spmind_report_table($data){
$report ='<strong>Average Score</strong>: '.$data[172].'
<strong>Score</strong>: '.$data[171];
return $report;
}
//Output
Average Score : 10
Score: 3
The output above is for illustration purposes only