Changeset 2450 for trunk/bp-messages/bp-messages-notifications.php
- Timestamp:
- 01/25/2010 02:48:13 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-messages/bp-messages-notifications.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-notifications.php
r2408 r2450 5 5 extract($args); 6 6 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 ); 10 8 11 9 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; 13 11 14 12 $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; 16 14 $settings_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'settings/notifications'; 17 15 18 16 // Set up and send the message 19 17 $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 ) ); 21 19 22 $ content = sprintf( __(20 $email_content = sprintf( __( 23 21 '%s sent you a new message: 24 22 … … 30 28 31 29 --------------------- 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 ); 33 31 34 32 $content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 35 33 36 34 // Send it 37 wp_mail( $to, $ subject, $content );35 wp_mail( $to, $email_subject, $email_content ); 38 36 } 39 37 } 40 41 38 42 39 /* 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.