Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2010 02:48:13 PM (16 years ago)
Author:
apeatling
Message:

Fixes #1686

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-notifications.php

    r2408 r2450  
    55    extract($args);
    66
    7     $message = new BP_Messages_Message( $item_id );
    8 
    9     $sender_name = bp_core_get_user_displayname( $message->sender_id );
     7    $sender_name = bp_core_get_user_displayname( $sender_id );
    108
    119    for ( $i = 0; $i < count($recipients); $i++ ) {
    12         if ( $message->sender_id == $recipients[$i]->user_id || 'no' == get_usermeta( $recipients[$i]->user_id, 'notification_messages_new_message' ) ) continue;
     10        if ( $sender_id == $recipients[$i]->user_id || 'no' == get_usermeta( $recipients[$i]->user_id, 'notification_messages_new_message' ) ) continue;
    1311
    1412        $ud = get_userdata( $recipients[$i]->user_id );
    15         $message_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'messages/view/' . $message->id;
     13        $message_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'messages/view/' . $message_id;
    1614        $settings_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'settings/notifications';
    1715
    1816        // Set up and send the message
    1917        $to = $ud->user_email;
    20         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes( $sender_name ) );
     18        $email_subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes( $sender_name ) );
    2119
    22         $content = sprintf( __(
     20        $email_content = sprintf( __(
    2321'%s sent you a new message:
    2422
     
    3028
    3129---------------------
    32 ', 'buddypress' ), $sender_name, stripslashes( wp_filter_kses( $message->subject ) ), stripslashes( wp_filter_kses( $message->message ) ), $message_link );
     30', 'buddypress' ), $sender_name, stripslashes( wp_filter_kses( $subject ) ), stripslashes( wp_filter_kses( $content ) ), $message_link );
    3331
    3432        $content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    3533
    3634        // Send it
    37         wp_mail( $to, $subject, $content );
     35        wp_mail( $to, $email_subject, $email_content );
    3836    }
    3937}
    40 
    4138
    4239/* This is too expensive to send on normal servers uncomment action at your own risk. */
Note: See TracChangeset for help on using the changeset viewer.