Support notification
-
Hi, i am using awersone support with my buddypress social network. So i ask if it is possible that the users receive notifications or message for reply ticket. Thanks
-
I’m not sure I understand your question. The plugin does send e-mail notifications every time a reply is added.
Yes
I still don’t understand what the question is π
Thank for your reply
My question: when administrator reply to a topic, the user whom created topic receive a notification or message buddypress ex: admin reply to your topic #457I’m sorry if I understood the question wrong, but there is no integration between Awesome Support and BuddyPress.
Awesome Support sends e-mail notification when new tickets and new replies are posted, but no link with BP here.
Yes, i want this e-mail notification arrives in buddypress message. I’m looking for a function to make it
Well in this case you will need to create a custom function. What you want to do is hook on those 2 hooks:
wpas_open_ticket_afterfor new ticketswpas_add_reply_afterfor new replies
For each scenario you’ll need to determine what to post and where to post in in BuddyPress.
Thank you. but I don’t know how i can write and send this in buddypress. Please write for me or give me an exemple.
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);
?>Work fine but How can i take a link directly to a ticket when i click in notification ?. That will be very good if you will add this function in plugin core.
To link to a ticket you just need to use the WordPress core function
get_permalink()and use the ticket ID (the post ID in fact) as the parameter.I tried but does not work. the link returns the same page
The topic ‘Support notification’ is closed to new replies.