Hi Julien, i wrote the function
<?php
function custom_filter_notifications_get_registered_components($component_names=array() ) {
if(!is_array($component_names) ) {
$component_names=array();
}
array_push($component_names,’custom’);
return $component_names;
}
add_filter(‘bp_notifications_get_registered_components’,’custom_filter_notifications_get_registered_components’);
function custom_format_buddypress_notifications($action,$ticket_id,$secondary_item_id,$total_items,$format=’string’) {
if(‘custom_action’ === $action) {
$custom_link= ‘/contact’;
$custom_text=’We have replied to your ticket’;
if(‘string’===$format) {
$return=apply_filters(‘custom_filter’,’‘.$custom_text.’‘);
}else{
$return=apply_filters(‘custom_filter’,array(
‘text’=>$custom_text,
‘link’=>$custom_link
),$custom_link, (int)$total_items,$custom_text,$custom_title);
}
return$return;
}
}
add_filter(‘bp_notifications_get_notifications_for_user’,’custom_format_buddypress_notifications’,10,5);
function bp_custom_add_notification($ticket_id,$comment_object) {
$author_id=$post->ID;
bp_notifications_add_notification(array(
‘user_id’=>$author_id,
‘item_id’=>$ticket_id,
‘component_name’=>’custom’,
‘component_action’=>’custom_action’,
‘date_notified’=>bp_core_current_time(),
‘is_new’=>1,
) );
}
add_action(‘wpas_add_reply_after’,’bp_custom_add_notification’,99,2);
?>