Hi,
Is there anyone who have done this before? Or should i assume that this is something not possible?
Thanks
Hello, if you’re still interested I had the same problem and found a solution I described in my blog here
Glad if I could help 🙂
Hi @riente,
I read your blog post twice but couldn’t get it…
Did you edit the original BP code?
Perhaps latest BP update changed the location of the function you edited.
My code looks something like that:
<?php
require('wp-load.php');
require_once('wp-includes/user.php');
require_once('wp-includes/pluggable.php');
require_once('wp-content/plugins/buddypress/bp-core/bp-core-loader.php');
$from_id=get_current_user_id();
if (empty($from_id)) exit; // do nothing if there's no current user
///////// ...some boring code here... ////////
$sum=10; // for example
$to_user_link = bp_core_get_userlink($to_id);
$from_user_link = bp_core_get_userlink($from_id);
$note_to="You got $sum points from $from_user_link"; // <--- notification to be sent to payee
$note_from="You sent $sum points to $to_user_link"; // <--- notification to be sent to payer
/********** Now how do I send the above notifications to the relevant users $from_id and $to_id? ********/
bp_core_add_notification( $item_id, $to, $component_name, $component_action, $secondary_item_id);
Thank you!