This topic has 10 replies, 3 voices, and was last updated 6 years by Benson.

  • Author
  • #39719
     mycolombianwife
    Participant

    I recently found out that also users which do not pay a membership can read messages sent from other user with a membership being send to their email.

    If paying user sends a message to an other non-paying user, the user without the membership will recieve an email including the subject and the entire text of the message!!

    The joke is that they just can not read the message when they log into their profile and only there, they are asked to pay for a membership when clicking on the subject of the message.

    Users which do not pay for a membership should not be abel to read messages AT ALL, because paying users can send their personal contact information and user which are not paying (users without memberships) can still read the message with the personal contact information sent directly to their email.

    This just doesn´t make sense for everyone who wants make money using this theme, because basically the users are supposed to pay for recieve the contact information.

    Users that do not pay shouldn´t be abel to read messages (including personal contact information from other users) AT ALL, because once the recieve the contact information (emails, facebook ect.) logically they do not have any motivation to pay for a membership.

    I hope I made myself clear.

    Please, is there any way to control that?

    Is there any way to not send them the entire text of the message to their emails, and inform them that in order to read the message they are supposed to buy a membership?

    Also, as mentioned in my other topic https://archived.seventhqueen.com/forums/topic/monitor-private-messages me including many other users of this theme would find it quite useful if you there would be an option to filter out personal contact information (emails, phone numbers ect.) beacause all good dating sites have this feautes, simple because it animates user to pay for a membership to recieve the contact information.

    #40074
     Abe
    Keymaster

    Hi, I will do some tests and add a new option to restrict the content from the email. will let you know

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #40595
     mycolombianwife
    Participant

    ok

    #41029
     Abe
    Keymaster

    Hi, please add this in your child theme functions.php until next update to remove the message content from the email messages:

    COPY CODE
    
    /* Restrict email messages content to non paying members */
    if ( ! function_exists('kleo_pmpro_restrict_pm_email_content')) {
        function kleo_pmpro_restrict_pm_email_content($email_content, $sender_name, $subject, $content, $message_link, $settings_link, $ud)
        {
    
            $restrict_message = false;
            $restrict_options = kleo_memberships();
            $area = 'pm';
    
            if (pmpro_getMembershipLevelForUser($ud->ID)) {
                $current_level_obj = pmpro_getMembershipLevelForUser($ud->ID);
                $current_level = $current_level_obj->ID;
    
                //if restrict my level
                if ($restrict_options[$area]['type'] == 2 && isset($restrict_options[$area]['levels']) && is_array($restrict_options[$area]['levels']) && !empty($restrict_options[$area]['levels']) && in_array($current_level, $restrict_options[$area]['levels'])) {
                    $restrict_message = true;
                }
    
            //not a member
            } else {
                if ($restrict_options[$area]['type'] == 2 && isset($restrict_options[$area]['not_member']) && $restrict_options[$area]['not_member'] == 1) {
                    $restrict_message = true;
                }
            }
    
            if ($restrict_message) {
    
                $content = 'Your current membership does not allow private messages access.';
                $email_content = sprintf(__(
                    '%1$s sent you a new message:
    
    Subject: %2$s
    
    "%3$s"
    
    To view and read your messages please log in and visit: %4$s
    
    ---------------------
    ', 'buddypress'), $sender_name, $subject, $content, $message_link);
    
                // Only show the disable notifications line if the settings component is enabled
                if (bp_is_active('settings')) {
                    $email_content .= sprintf(__('To disable these notifications, please log in and go to: %s', 'buddypress'), $settings_link);
                }
    
                return $email_content;
            }
    
            return $email_content;
    
        }
    }
    add_filter( 'messages_notification_new_message_message', 'kleo_pmpro_restrict_pm_email_content', 11, 7 );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #41183
     mycolombianwife
    Participant

    Thank you. I appreciate it!

    #125783
     mycolombianwife
    Participant

    Hello this code doesn´t work anymore.

    #125784
     mycolombianwife
    Participant

    My functions php in the child theme folder looks like this

    `
    <?php

    /* Restrict email messages content to non paying members */
    if ( ! function_exists(‘kleo_pmpro_restrict_pm_email_content’)) {
    function kleo_pmpro_restrict_pm_email_content($email_content, $sender_name, $subject, $content, $message_link, $settings_link, $ud)
    {

    $restrict_message = false;
    $restrict_options = kleo_memberships();
    $area = ‘pm’;

    if (pmpro_getMembershipLevelForUser($ud->ID)) {
    $current_level_obj = pmpro_getMembershipLevelForUser($ud->ID);
    $current_level = $current_level_obj->ID;

    //if restrict my level
    if ($restrict_options[$area][‘type’] == 2 && isset($restrict_options[$area][‘levels’]) && is_array($restrict_options[$area][‘levels’]) && !empty($restrict_options[$area][‘levels’]) && in_array($current_level, $restrict_options[$area][‘levels’])) {
    $restrict_message = true;
    }

    //not a member
    } else {
    if ($restrict_options[$area][‘type’] == 2 && isset($restrict_options[$area][‘not_member’]) && $restrict_options[$area][‘not_member’] == 1) {
    $restrict_message = true;
    }
    }

    if ($restrict_message) {

    $content = ‘The message is not visible for you at the moment. Only after the full payment of a tour of at least 2 days you can view and send messages. ‘;
    $email_content = sprintf(__(
    ‘%1$s sent you a new message:

    Subject: %2$s

    “%3$s”

    To view and read your messages please log in and visit: %4$s

    ———————
    ‘, ‘buddypress’), $sender_name, $subject, $content, $message_link);

    // Only show the disable notifications line if the settings component is enabled
    if (bp_is_active(‘settings’)) {
    $email_content .= sprintf(__(‘To disable these notifications, please log in and go to: %s’, ‘buddypress’), $settings_link);
    }

    return $email_content;
    }

    return $email_content;

    }
    }
    add_filter( ‘messages_notification_new_message_message’, ‘kleo_pmpro_restrict_pm_email_content’, 11, 7 );

    //Minify
    add_filter(‘bwp_minify_style_ignore’, ‘exclude_my_css’);

    function exclude_my_css($excluded)
    {
    $excluded = array(‘app’,’foundation’,’foundation-responsive’);
    return $excluded;
    }

    function remove_public_message_button() {
    remove_filter( ‘bp_member_header_actions’,’bp_send_public_message_button’, 20);

    }
    add_action( ‘bp_member_header_actions’, ‘remove_public_message_button’ );

    /**
    * @package WordPress
    * @subpackage Sweetdate
    * @author SeventhQueen <themesupport@seventhqueen.com>
    * @since Sweetdate 1.0
    */

    /**
    * Sweetdate Child Theme Functions
    * Add extra code or replace existing functions
    */

    add_filter( ‘bp_get_message_thread_excerpt’, ‘kleo_custom_message_length’);
    function kleo_custom_message_length($text) {
    return substr( $text,0 , 6 );
    }
    //Hide members without avatars
    add_action( ‘bp_core_delete_existing_avatar’, ‘log_avatar_deleted’ );
    add_action( ‘xprofile_avatar_uploaded’, ‘log_avatar_uploaded’ );

    //on new avatar upload, record it to user meta
    function log_avatar_uploaded(){
    update_user_meta(bp_loggedin_user_id(), ‘has_avatar’, 1);
    }

    //on delete avatar, delete it from user meta
    function log_avatar_deleted($args){
    if($args[‘object’]!=’user’)
    return;
    //we are sure it was user avatar delete
    //remove the log from user meta
    delete_user_meta(bp_loggedin_user_id(), ‘has_avatar’);
    }

    function modify_loop_and_pag($qs, $object=false) {
    global $wpdb;
    $include = ”;

    if( $object != ‘members’ )//hide for members only
    return $qs;

    $subscribers = $wpdb->get_results(“SELECT user_id FROM {$wpdb->usermeta } WHERE meta_key=’has_avatar'” , ARRAY_N );
    foreach($subscribers as $subscriber){
    $include = $include . “,” . $subscriber[0];
    }

    $args = wp_parse_args( $qs );

    //check if we are listing friends?, do not apply in this case

    if( !empty( $args[‘include’] ) ) {
    $args[‘include’] = $args[‘include’] . ‘,’ . $include;
    }
    else {
    $args[‘include’] = $include;
    }

    $qs = build_query($args);

    return $qs;

    }
    add_action( ‘bp_ajax_querystring’ , ‘modify_loop_and_pag’, 25, 2 );

    function current_user_has_avatar($id) {
    global $bp;
    if ( bp_core_fetch_avatar( array( ‘item_id’ => $id, ‘no_grav’ => true,’html’=> false ) ) != bp_core_avatar_default( ‘local’ ) ) {
    return true;
    }
    return false;
    }

    // ATTENTION
    // This code should be deleted after first site load with the code
    //
    function init_avatar_meta(){
    global $wpdb;
    $ids=$wpdb->get_col(“SELECT ID FROM $wpdb->users”);//we don’t need to check for meta value anyway
    foreach( $ids as $id ){
    if( current_user_has_avatar($id) ){
    update_user_meta( $id, ‘has_avatar’, 1 );
    } else {
    delete_user_meta( $id, ‘has_avatar’ );
    }
    }
    }
    add_action(‘init’, ‘init_avatar_meta’);
    ?>

    #125842
     Abe
    Keymaster

    You should make sure you use the latest theme available since that should be fixed

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #203057
     Benson
    Participant

    Does this code work with latest update and exactly where should this code be added in child theme functions.php

    #203137
     Abe
    Keymaster

    Hello, all emails related to BuddyPress are configured from Wp admin – Emails so that code is no longer available.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #203460
     Benson
    Participant

    Ok, but is there any instructions how top set up so non paying members cant read private messages until they have paid their membership

    How do we set it up?

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Non-members can still read messages in their email!!’ is closed to new replies.

Log in with your credentials

Forgot your details?