group_messages_notification_new_message (数组raw_args美元数组()

发送电子邮件通知收件人有新的未读群组消息。

描述

参数

raw_args美元

数组(可选)

默认值:数组()

文件:bp-messages / bp-messages-functions.php

Function group_messages_notification_new_message($raw_args = array()) {if (is_object($raw_args)) {$args = (array) $raw_args;} else {$args = $raw_args;} //这些应该在下面提取。接受美元= array ();$email_subject = $subject = $email_content = ";$sender_id = $id = 0;/ /呕吐。提取(args);If(空($接收者)){返回;} $sender_name = bp_core_get_user_displayname($sender_id); if ( isset( $message ) ) { $message = wpautop( $message ); } else { $message = ''; } // Send an email to each recipient. foreach ( $recipients as $recipient ) { if ( $sender_id == $recipient->user_id || 'no' == bp_get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) ) { continue; } // User data and links. $ud = get_userdata( $recipient->user_id ); if ( empty( $ud ) ) { continue; } $unsubscribe_args = array( 'user_id' => $recipient->user_id, 'notification_type' => 'group-message-email', ); $group = bp_messages_get_meta( $id, 'group_id', true ); $group_name = bp_get_group_name( groups_get_group( $group ) ); bp_send_email( 'group-message-email', $ud, array( 'tokens' => array( 'message_id' => $id, 'usermessage' => stripslashes( $message ), 'message' => stripslashes( $message ), 'message.url' => esc_url( bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() . '/view/' . $thread_id . '/' ), 'sender.name' => $sender_name, 'usersubject' => sanitize_text_field( stripslashes( $subject ) ), 'group.name' => $group_name, 'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ), ), ) ); } /** * Fires after the sending of a new group message email notification. * * @since BuddyPress 1.5.0 * @deprecated 2.5.0 Use the filters in BP_Email. * $email_subject and $email_content arguments unset and deprecated. * * @param array $recipients User IDs of recipients. * @param string $email_subject Deprecated in 2.5; now an empty string. * @param string $email_content Deprecated in 2.5; now an empty string. * @param array $args Array of originally provided arguments. */ do_action( 'group_messages_notification_new_message', $recipients, '', '', $args ); }

更新日志

更新日志
版本 描述
BuddyBoss 1.2.9 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队