Support » Plugin: Realtyna Organic IDX plugin + WPL Real Estate » Send message to listing agent thought buddypress

  • Resolved eirikv

    (@eirikv)



    Hi,

    I wounder where I can put the following code to implement
    a message button to send a private message trough
    buddypress, rather than a listing agents contact form.
    (a message copy to their email is sent anyway by BP)

    … an if the code gets the listing agent?

    /**
    * Add buddypress message form after agent info
    */
    
    function bp_custom_get_send_private_message_link($to_id,$subject=false,$message=false) {
    
    //if user is not logged, do not prepare the link
    if ( !is_user_logged_in() )
    return false;
    
    $compose_url=bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?';
    if($to_id)
    $compose_url.=('r=' . bp_core_get_username( $to_id ));
    if($subject) 
    $compose_url.=('&subject='.$subject);
    
    /*if($message)
    * $compose_url.=("&content=".$message);
    */
    
    return wp_nonce_url( $compose_url ) ;
    }
    
    //for auto populating message content 
    
    add_filter('bp_get_messages_content_value','bp_custom_message_content_value');
    function bp_custom_message_content_value($content){
    
    if(!empty ($content))
    return $content;
    $content=$_REQUEST['content'];
    
    return $content;
    }
Viewing 1 replies (of 1 total)
  • Plugin Author Realtyna

    (@realtyna)

    Hi,

    You can add a function to following hook and do what you want.

    contact_agent

    You should be able to see the submitted form data on $_POST variable.
    Please let us know if there is anything else we can help you with.

    Regards,
    Realtyna Support Team

Viewing 1 replies (of 1 total)
  • The topic ‘Send message to listing agent thought buddypress’ is closed to new replies.