وردپرس

BuddyBoss+GES sending too many emails when uploading files to BB Documents area


Hi. I had a problem with BuddyBoss and GES and wanted to share a solution.

When uploading multiple files to the GG Group documents area, many notification emails are sent by GES, most of which are blank.

For example, if you select and upload 3 files in one update and add some text to the upload comment, a total of 7 notification emails are sent; 3 with blank content, 1 with upload comment and then another 3 with blank content!

BB have confirmed this is as designed!!

But it is possible to filter out the blank activities (emails) using the code below.

/**
 * Prevent activity item queuing if the Activity_type is "activity_update" and the 
 * activity content is empty.
 *
 * @param bool                 $send     Defaults to true. Return false to stop this item from being queued.
 * @param string               $type     Activity type.
 * @param BP_Activity_Activity $activity Activity item.
 */
function hws_ass_block_group_activity_types( $send, $activity_type, $activity_item)
{
	if ("activity_update" == $activity_type && isset($activity_item) && empty($activity_item->content) ) {
		$send = false;
	}
	return $send;
}
add_filter( 'ass_block_group_activity_types', 'hws_ass_block_group_activity_types', 10, 3 );

I hope this helps someone else as I went around in circles for quite a while before working this out. -C

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا