How to send a notification with email.
-
Hi,
I have manage to do the following:
1. Create an activity
2. Create a notification for that activityI have used the following code as proof of concept:
add_action('bp_ready', function() { //1. Add an action $activity_id = bp_activity_add([ 'action' => '<b>HEJHEJHEJ</b>', 'content' => '<b>my content my content my content my content my content my content</b>', 'component' => 'groups', 'type' => 'activity_update', 'user_id' => get_current_user_id(), ]); //2. Send the notification if (bp_is_active('notifications')) { $activity = new BP_Activity_Activity($activity_id); $notification = bp_notifications_add_notification(array( 'item_id' => $activity->id, 'secondary_item_id' => $activity->user_id, 'user_id' => $activity->user_id, 'component_name' => buddypress()->activity->id, 'component_action' => 'new_at_mention', 'date_notified' => bp_core_current_time(), 'is_new' => 1, )); } });
So how do i make Buddypress to send an email to the user about that notification? Is there any tutorial that describes the process?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to send a notification with email.’ is closed to new replies.