• Hi, if someone needs to send a notification, this might get you started:

    function samen_bbp_rc_reported_topic( $topic_id ) {
    	$topic = bbp_get_topic( $topic_id );
    
    	$subject = 'Forum message reported';
    
    	// Set the Mail Content
    	$mail_body = '
    Hello,
    
    Somebody reported a forum post.
    
    Have a good day.
    The editors of this website.
    
    Forum message: ' . get_permalink( $topic_id ) . '
    Manage that message: ' . admin_url( '/post.php?post=' . $topic_id . '&action=edit' ) . '
    ';
    
    	// Set the Mail Headers
    	$header = "From: " . " <" . get_bloginfo('admin_email') . ">\r\n";
    	$header .= "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail
    
    	wp_mail( get_bloginfo('admin_email'), $subject, $mail_body, $header );
    }
    add_action( 'bbp_rc_reported_topic', 'samen_bbp_rc_reported_topic' );

    https://www.ads-software.com/plugins/bbpress-report-content/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Marcel Pol

    (@mpol)

    For the reporting of replies, it could use a similar function with this action:

    add_action( 'bbp_rc_reported_reply', 'samen_bbp_rc_reported_reply' );

    Thank you, Marcel,

    For those (like me) not well versed in code and themes, where might this function be entered?

    Thread Starter Marcel Pol

    (@mpol)

    It can be added to functions.php of your theme. Or you can make it into your own plugin.

    wpfiend

    (@wpfiend)

    Hi Marcel.

    The code that you have provided above is not working on the latest version of WordPress and bbPress.

    Would you consider updating it so that it works…??

    Much obliged.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Notification email, sample code.’ is closed to new replies.