-
Author
-
April 1, 2018 at 18:19 #193601mycolombianwifeParticipant
Hello I ´m reffing to a post that I made a couple of years ago.
https://archived.seventhqueen.com/forums/topic/non-members-can-still-read-messages-in-their-email
You gave me a code then, but I tried it and it doesn´t work anymore.
I have the theme versio 3.2.1 now.
I will attach the code below.
What I need is that non members ( users that have not a paid membership pro membership level)
can read the full messages that are being sent to them, in their emai, because other users send their phone number immediately.I need that of they are not a member, that they will get a notice that in order to read this message, they have to purchase a membership first and only show about the first 3 words of the message.
Can you provide a solution for that?
The following is the code that doesnt work anymore:
/* 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 );
April 1, 2018 at 18:29 #193603Kieran_SQModeratorHi,
Thanks for contacting us about the issues you’re having with custom code. Please try removing the code completely from your functions.php file and test the interactions again. Make sure to test with a user that should not receive the message content (AKA: any user that has a level that restricts the message functionality).
As per the secondary question. It will not be possible without significant new code to add a preview of the first part of a message. If you wished to achieve this you would either need to code this yourself, reach out to a third party developer or contact our own development team by emailing dev@seventhqueen.com
Thanks,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
April 6, 2018 at 20:55 #193966mycolombianwifeParticipantHello !
I have tried that ( deleted the code completely from the function.php ) but “non-members” still receive the entire messsage send in their email !
1. Is that so by default ?
2. The problem is that some users send phone numbers or emails immediately to “non-members” and they recieve the entire msg in their email ?
What can be done ?
What if we turn off the email notifications for non-members?
April 7, 2018 at 04:13 #193988Kieran_SQModeratorHi,
Can you please update this ticket, in a private reply, with the following information so I can look into this for you.
– Admin credentials
– New user credentials with a full package assigned to it
– New user credentials with a the basic (restricted) package assigned to it. Please set the email for this account to kieran@seventhqueen.com
– PHP error log (if you do not know how to get this please ask your host)Thanks,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
-
AuthorPosts
You must be logged in to reply to this topic.