Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Buddy Quaid
    Participant

    @buddyq

    I answered my own question, so I’ll post my solution here.

    Page: /plugins/buddypress/bp-blogs/classes/class-bp-blogs-blog.php

    It’s a hack so I hope there is a way I can do this WITHOUT a hack. Someone please let me know!!!

    LINE: 236

    wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND (wb.deleted = 0 OR wb.deleted = 1) {$hidden_sql}

    LINE: 250

    wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND (wb.deleted = 0 OR wb.deleted = 1) {$hidden_sql}


    Buddy Quaid
    Participant

    @buddyq

    Hi Shane,

    bp_ready worked! Thank you. I forgot to reply and say that it did work.


    Buddy Quaid
    Participant

    @buddyq

    Thanks!


    Buddy Quaid
    Participant

    @buddyq

    I cleared up the errors and got an email to send.

    Question:

    Is it possible to create a new template for certain emails? If I create a new template called single-bp-email-custom-2.php and put that in my /MY-THEME/buddypress/assets/emails folder. How do I tell bp_send_email() function to use it?


    Buddy Quaid
    Participant

    @buddyq

    UPDATE: GETTING CLOSER… I think

    So it’s confusing…. I changed the terms to aa_site_expired instead of “your-agentassets-pro…” etc.
    I changed it to the “situation” slug instead of the “email” slug.

    Question: How do I tell it that I want to send that particular email that I created. Multiple emails can have the same “situation” selected. So how do you tell it WHICH email you want to send? Seems confusing. However, changing it now let me past the “missing_email” error and now gives me a fatal error:

    Fatal error: Uncaught Error: Call to a member function get_address() on null in /home/aabiz/public_html/wp-content/plugins/buddypress/bp-core/bp-core-functions.php:3218 
    
    Stack trace: 
    #0 /home/aabiz/public_html/wp-content/plugins/agentassets-site-manager/includes/aa-agentassets-class.php(421): bp_send_email('aa_site_expired', NULL, Array) 
    #1 /home/aabiz/public_html/wp-content/plugins/agentassets-site-manager/includes/aa-check-for-expired-sites.php(77): AgentAssets::deactivate_expired_blogs(Array) 
    #2 /home/aabiz/public_html/wp-content/themes/agent-assets/buddypress/blogs/blogs-loop.php(22): getAllBlogsDetails() 
    #3 /home/aabiz/public_html/wp-includes/template.php(724): require('/home/aabiz/pub...') 
    #4 /home/aabiz/public_html/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php(155): load_template('/home/aabiz/pub...', false) 
    #5 /home/aabiz/public_html/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php(61): bp_locate_template(Array, true, false) 
    #6 /home/aabiz/public_html/wp-content/themes/agent-ass in /home/aabiz/public_html/wp-content/plugins/buddypress/bp-core/bp-core-functions.php on line 3218

    Looks like it’s the NULL in:
    bp_send_email('aa_site_expired', NULL, Array)

    But I put in my email address in the call… why doesn’t this work?
    $sent = bp_send_email( 'aa_site_expired', 'bquaid@gmail.com', $args );


    Buddy Quaid
    Participant

    @buddyq

    @espellcaste thanks for the reply but i’ve read all of the resources already that you posted. My question is why use bp_core_install_emails if I can just create my email in BuddyPress Emails as shown in the screenshot below?

    My BP Email Test with a custom token for site.id
    http://scrgrb.in/76g

    BP Email slug – “your-agentassets-property-site-has-been-deactivated”
    http://scrgrb.in/76i

    My script gets all sites needing to be deactivated and sends to this function. Inside the function, I have this code:

    $args  = array(
        		'tokens' => array(
        			'site.id'             => $site_id,
        		),
        	);
        	$sent = bp_send_email( 'your-agentassets-property-site-has-been-deactivated', 'bquaid@gmail.com', $args );
            print_r($sent);

    What am I missing here? The array getting printed out is:

    WP_Error Object
    (
        [errors] => Array
            (
                [missing_email] => Array
                    (
                        [0] => bp_get_email
                    )
    
            )
    
        [error_data] => Array
            (
                [missing_email] => Array
                    (
                        [0] => your-agentassets-property-site-has-been-deactivated
                        [1] => Array
                            (
                                [no_found_rows] => 1
                                [numberposts] => 1
                                [post_status] => publish
                                [post_type] => bp-email
                                [suppress_filters] => 
                                [tax_query] => Array
                                    (
                                        [0] => Array
                                            (
                                                [field] => slug
                                                [taxonomy] => bp-email-type
                                                [terms] => your-agentassets-property-site-has-been-deactivated
                                            )
    
                                    )
    
                            )
    
                    )
    
            )
    
    )

    Buddy Quaid
    Participant

    @buddyq

    I’m now in the same boat with Matt2012. I am getting missing_email error.

    Not sure why. I created the email in the BuddyPress Emails and copy and pasted the used slug for the email.


    Buddy Quaid
    Participant

    @buddyq

    I have an update for adding situations… since nobody from BuddyPress helps or seems to get on this site anymore, I guess I’ll post this for anyone who needs this.

    (Maybe that’s why BuddyBoss came out?)

    Anyway, I got the situations to show up by going changing to:

    plugins/buddypress/bp-core/bp-core-taxonomy.php and changing line #39 ‘show_in_menu’ to true instead of false.

    This makes it show up and you can change everything and add new ones.


    Buddy Quaid
    Participant

    @buddyq

    Hey there,

    Starting a similar thing and found this thread somewhat useful… can someone help me fill the gaps?

    1) @Matt2012, I use Postman too. Did you ever figure this part out?
    2) How in the world do you add a new “situation” in BuddyPress Emails? There is NO documentation on this that I can find.

    My situation:

    Using a cron job to find all sites expired or almost expired and send the users the right email. I have the arrays of users ready to go. I just need to programatically send these user ID’s to be emailed with the correct template.

    Those templates would then use their own tokens to fill in the gaps. You site: {{site.name}} is now expired. Do this and that. It expired on: {{expiration.date}}.

    How do I do this?


    Buddy Quaid
    Participant

    @buddyq

    Hey guys,

    Any help on this? Where are the developers and the help? Bueller?


    Buddy Quaid
    Participant

    @buddyq

    Hey there!!! Looks like using bp_ready worked! Thanks@


    Buddy Quaid
    Participant

    @buddyq

    Having the same type of issue. I cant use xprofile_get_field_data from the functions.php in a child theme.


    Buddy Quaid
    Participant

    @buddyq

    I just disabled BuddyPress from the Network > Dashboard > Plugins

    and the registration page started working. It was showing BuddyPress fields and I was wondering how this could be happening since I just disabled it.

    I checked out the main sites plugins and BuddyPress is activated there. So my question is, could it have been double activated? Once on the website and once in the network? I have a multisite operation. Where should it be activated? Network or on the actual site?


    Buddy Quaid
    Participant

    @buddyq

    I have disabled all plugins and the problem persists. It’s not a plugin thing.

    I’m at my wits end with it. I have no clue. I’m out of ideas. I’m usually pretty good at troublehsooting these things. I’m hoping it’s something really stupid.

    Please help!


    Buddy Quaid
    Participant

    @buddyq

    I will start trying this.


    Buddy Quaid
    Participant

    @buddyq

    Hi Vaparun,

    I re-saved permalinks and re-saved pages options and no change.


    Buddy Quaid
    Participant

    @buddyq

    I know this is old, but I am having the same issue and not using a caching plugin.

    What now?


    Buddy Quaid
    Participant

    @buddyq

    UPDATE:

    I got things ALMOST working now. Looks like this code MUST be in a function in order to operate properly for some reason.

    Here is the code:

    $user_id = $user->ID;
    write_log('$user_id: '. $user_id); // This output the user ID correctly in my log!
    $users_name = xprofile_get_field_data( 'Name', $user_id );

    This does NOT work. It’s blank. For some reason it will not fetch the user id.

    The following code DOES work:

     $user_id = $user->ID;
      write_log('$user_id: '. $user_id);
      $users_name = xprofile_get_field_data( 'Name', 3 );

    Just hard coding the user_id actually gives me a result.
    Why is it not taking the $user_id which does output a real value?

Viewing 18 replies - 1 through 18 (of 18 total)
Skip to toolbar