Skip to:
Content
Pages
Categories
Search
Top
Bottom

guest email notification on trunk version ?

  • Hi,

    I use BBpress Version 1.1-alpha-2539 (trunk version), what is great with this version two new options :

    – anonymous posting

    – email notification on new replay to your topic/comments

    Yes this is ok, but i need some thing more : the email notification is avalaible only for registred membre, not for anonymous posting … so how can us get this option work for guest posting ?

    thank’s

Viewing 3 replies - 1 through 3 (of 3 total)

  • zaerl
    Participant

    @zaerl

    You can’t. Anonymous posting = no email = no notification.

    No no on trunk version anonymous post like on wordpress with name + email + siteweb.


    vahid mohammadi
    Participant

    @wvmohzoibar

    Hi
    you can use this code:

    add_action( 'bbp_new_reply',  'update_reply', 0, 6 );
    function update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false ) {
    
    	$reply_id = bbp_get_reply_id( $reply_id );
    	$topic_id = bbp_get_topic_id( $topic_id );
    
    	if ( !bbp_is_topic_published( $topic_id ) || !bbp_is_reply_published( $reply_id ) ) return;
    
    	// $topic_email = bbp_get_topic_author_email($topic_id);
    	if (!empty($topic_id)) {
    		// if user is anonymous
    		if (bbp_is_topic_anonymous($topic_id)) {
    			$author_email = get_post_meta($topic_id, '_bbp_anonymous_email', true);
    			if ($author_email == 'nobody@example.com') return;
    
    			$topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
    			$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
    			$reply_url     = bbp_get_reply_url( $reply_id );
    			$blog_name     = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    
    			$email_subject = $blog_name . ': ' . __( 'New reply to your topic', 'etuts' ) . '"' . $topic_title . '"';
    			$email_content = __( "New reply to your topic\nIn order to view the reply, open the bellow link\n", 'etuts' ) . $reply_url;
    
    			wp_mail( $author_email, $email_subject, $email_content );
    		}
    	}
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar