Replies
- Lefteris on May 9, 2021 at 7:58 pm in reply to: [Resolved] Send email to user that has been inactive for 2 months #38558
Thank you so much @Ravi , your help has been magnificent!!
Could you just check what i did from point of view of syntax? https://pastebin.com/EfASFZNa
Your code works perfectly fine. Just hade to change
date_recorded < current_date - interval 2 month
for getting all users who haven’t logged in for the last 2 months.Is the `if ( empty( $user_ids ) ) {
return;
}correct or should i just make an
if ( ! empty( $user_ids ) )in the
foreach ( $user_ids as $user_id )` loop?Thank you again for you time. I am grateful for your support.
- Lefteris on May 7, 2021 at 2:00 pm in reply to: [Resolved] Send email to all featured members when a site wide notice is published #38534
Thank you @Ravi for your help 🙂
I wll test that.
Do you know maybe how can i get the text of the message?
I have tried some testing with different variations likeglobal $messages_template; echo '' . bp_message_notice_text($messages_template->thread->message) . '';
or
global $notice; echo '' . bp_get_message_notice_text( $notice->message ) . '';
but i get Warning: Creating default object from empty value.
- Lefteris on May 7, 2021 at 10:33 am in reply to: [Resolved] Send email to user that has been inactive for 2 months #38529
thank you @Tosin for your info. But this plugin is not actually what i am looking for.But i will have a look on it.
@Brajesh could you please take a look on the query below and give me a hint what am i doing wrong :
// Get the contributors and administrators who haven't logged in for 60 days $args = array( 'role__in' => array( 'contributor', 'administrator' ), 'meta_key' => 'last_activity', // this is a meta_key storing the last time the user was logged in by buddypress in 'Y-m-d H:i:s' format 'meta_query' => array( array( 'key' => 'last_activity', 'value' => date('Y-m-d H:i:s', strtotime( "-60 days" )), // what am i doing wrong? 'compare' => '<', 'type' => 'DATE' // Let WordPress know we're working with date ) ) ); $remind_users = new WP_User_Query( $args );
I am trying to get the inactive users for the last 60 days, but for some reason it doesn’t give me the correct result. Any help please? @Ravi
- Lefteris on April 28, 2021 at 10:59 am in reply to: [Resolved] Return in bp_members_suggestions_query_args only bp featured members #38359
Thank you so much Ravi for your help.
It works perfect.
- Lefteris on April 27, 2021 at 2:05 pm in reply to: [Resolved] Return in bp_members_suggestions_query_args only bp featured members #38328
Hello Ravi,
May i ask another modification on this.
If the current_user is not a bp_featured_member , return no results at all.Thank you for your time
- Lefteris on April 24, 2021 at 2:08 pm in reply to: [Resolved] Send email to user that has been inactive for 2 months #38287
Hello @Brajesh and thank you very much for your help.
After some digging that i have done, i have created a small plugin to do the work.
I am just stucked in some points and not sure how to proceed.I would like to share what i did, since i sincerely believe that you have a good community + a very supportive forum and i like sharing.
Please have a short look on it and let me know if you have any suggestions-corrections .
https://pastebin.com/Unz9kXYi(I have made it as a plugin so that if i want to disalbe the emails, to just disable the plugin.)
- Lefteris on April 14, 2021 at 3:13 pm in reply to: [Resolved] Return in bp_members_suggestions_query_args only bp featured members #37797
Thank you Ravi for all the info and your help.
- Lefteris on April 13, 2021 at 11:12 am in reply to: [Resolved] Return in bp_members_suggestions_query_args only bp featured members #37727
Yes Ravi.This worked perfect 🙂 thank you for your help.
Just another very quick general BP question. What would be the correct hook to send a one time confirmation email to the user when his account passed the authentication process(upon registration we send an email with a link, the user authenticate his account and then he can login). Would it be
bp_core_activated_user
orbp_core_signup_user
or something else? We need to send the one time email after the user authenticated (no need to necessary login).Thank you for your time
- Lefteris on April 13, 2021 at 6:57 am in reply to: [Resolved] Return in bp_members_suggestions_query_args only bp featured members #37707
Thank you very much for your help Ravi.
But this didn’t work. It didn’t excluded the current user from results.
Any ideas? 🙂 - Lefteris on April 12, 2021 at 5:24 pm in reply to: [Resolved] Return in bp_members_suggestions_query_args only bp featured members #37673
*Note: The current user may be or may not be a featured member, he sould always be exluded from the returned $args