diff --git a/change_log.txt b/change_log.txt index a833e94..3f5171f 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ v1.0.4 Compliment user settings page - ADDED Linebreaks are removed on compliment messages - FIXED Compliments message links are clickable - ADDED +Email notifications not working - FIXED v1.0.1 Use singular name instead of slug name - FIXED diff --git a/includes/bp-compliments-notifications.php b/includes/bp-compliments-notifications.php index c0493a1..1629663 100644 --- a/includes/bp-compliments-notifications.php +++ b/includes/bp-compliments-notifications.php @@ -46,7 +46,7 @@ function bp_compliments_format_notifications( $action, $item_id, $secondary_item $text = false; if ( 1 == $total_items ) { - $text = sprintf( __( '%s has sent you a %s', 'bp-compliments' ), bp_core_get_user_displayname( $item_id ), strtolower(BP_COMP_SINGULAR_NAME) ); + $text = sprintf( __( '%s has sent you a %s', 'bp-compliments' ), bp_core_get_user_displayname( $item_id ), BP_COMP_SINGULAR_NAME ); $link = bp_core_get_user_domain( $bp->loggedin_user->id ) .BP_COMPLIMENTS_SLUG. '/?bpc_read=true&bpc_sender_id='.$item_id; } break; @@ -151,10 +151,11 @@ function bp_compliments_notifications_add_on_compliment( BP_Compliments $complim * @since 0.0.2 * @package BuddyPress_Compliments * + * @param array $args Sender and Receiver user ID. * @return bool */ -function bp_compliments_new_compliment_email_notification() { - $args = ''; +function bp_compliments_new_compliment_email_notification($args = array()) { +// $args = ''; $defaults = array( 'receiver_id' => bp_displayed_user_id(), @@ -166,17 +167,6 @@ function bp_compliments_new_compliment_email_notification() { if ( 'no' == bp_get_user_meta( (int) $r['receiver_id'], 'notification_on_compliments', true ) ) return false; - // Check to see if this receiver has already been notified of this sender before - $has_notified = bp_get_user_meta( $r['sender_id'], 'bp_compliments_has_notified', true ); - - // Already notified so don't send another email - if ( in_array( $r['receiver_id'], (array) $has_notified ) ) - return false; - - // Not been notified before, update usermeta and continue to mail - $has_notified[] = $r['receiver_id']; - bp_update_user_meta( $r['sender_id'], 'bp_compliments_has_notified', $has_notified ); - $sender_name = bp_core_get_user_displayname( $r['sender_id'] ); $compliment_link = bp_core_get_user_domain( $r['receiver_id'] ) .BP_COMPLIMENTS_SLUG. '/?bpc_read=true&bpc_sender_id='.$r['sender_id']; diff --git a/includes/bp-compliments-settings.php b/includes/bp-compliments-settings.php index c969e45..8fa066a 100644 --- a/includes/bp-compliments-settings.php +++ b/includes/bp-compliments-settings.php @@ -72,7 +72,7 @@ function bp_compliments_settings_page() { - + @@ -92,7 +92,7 @@ function bp_compliments_settings_page() { - + diff --git a/includes/templates/buddypress/members/single/compliments.php b/includes/templates/buddypress/members/single/compliments.php index 7501664..0b4c740 100644 --- a/includes/templates/buddypress/members/single/compliments.php +++ b/includes/templates/buddypress/members/single/compliments.php @@ -118,7 +118,8 @@ class='preview-upload'/> message)); ?> + $comp_message = apply_filters('bp_comp_message', $comp->message); + echo $comp_message; ?>