BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #37384

    Hi guys! Great work! It’s working perfectly. Now I have a question.. where can I translate the content of the email sent? I can translate to Spanish if you need. Thank you so much for your work!

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #36586

    If I paste the code then a critical error appears in my web.

    Don’t know what to do..

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #36585

    Hi guys thank you!

    Something wrong it’s happening when I create the file bp-custom.php

    The content of the code is appearing before the header of my page. Please, I need to know if the text I’m writing in this file is correct maybe I’m not writing the correct code.

    Thanks for your help!!

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #36539

    Hello Brajesh,

    This is the code I’m trying to use. I’ve created a bp-custom folder and inside I’ve created a file named bp-custom.

    I don’t know if I’m doing well, please tell me.

    https://pastebin.com/ggTzpYdb

    So thankfull!

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #36505

    Thanks for helping!

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #36504

    I saw there is a code to send emails to everyone about the group activity but isn’t working in mi web.

    The text was:

    “Notify by email:-
    This plugin does not support notification by email out of the box. The email notifications are resource intensive and based on the number of members of group, may cause timeouts. If you still believe that you want the email notification, you can put the following code in your bp-custom.php

    PHP
    function buddydev_mail_on_new_group_activity( $user_ids, $args ) {

    if ( empty($user_ids ) ) {
    return ;
    }
    //do a bulk query
    $users = get_users( array( ‘include’ => $user_ids ) );

    $group = new BP_Groups_Group( $args[‘group_id’] );
    $loggedin_user_display_name = bp_get_loggedin_user_fullname();

    $activity = new BP_Activity_Activity( $args[‘activity_id’] );

    $activity_content = $activity->content;
    $activity_permalink = bp_activity_get_permalink( $activity->id, $activity );

    $subject = sprintf( ‘%1$s posted to %2$s’, $loggedin_user_display_name, $group->name );
    $message = <<<‘MAINCONTENT’
    Hi %1$s,
    %2$s posted…

    %3$s

    Link: %4$s
    MAINCONTENT;

    foreach ( $users as $user ) {
    $message = sprintf( $message, $user->displayname, $loggedin_user_display_name, $activity_content, $activity_permalink );
    wp_mail( $user->user_email, $subject, $message );
    }
    }
    add_action( ‘bp_group_activities_notify_members’, ‘buddydev_mail_on_new_group_activity’, 10, );
    function buddydev_mail_on_new_group_activity( $user_ids, $args ) {

    if ( empty($user_ids ) ) {
    return ;
    }
    //do a bulk query
    $users = get_users( array( ‘include’ => $user_ids ) );

    $group = new BP_Groups_Group( $args[‘group_id’] );
    $loggedin_user_display_name = bp_get_loggedin_user_fullname();

    $activity = new BP_Activity_Activity( $args[‘activity_id’] );

    $activity_content = $activity->content;
    $activity_permalink = bp_activity_get_permalink( $activity->id, $activity );

    $subject = sprintf( ‘%1$s posted to %2$s’, $loggedin_user_display_name, $group->name );
    $message = <<<‘MAINCONTENT’
    Hi %1$s,
    %2$s posted…

    %3$s

    Link: %4$s
    MAINCONTENT;

    foreach ( $users as $user ) {
    $message = sprintf( $message, $user->displayname, $loggedin_user_display_name, $activity_content, $activity_permalink );
    wp_mail( $user->user_email, $subject, $message );
    }
    }
    add_action( ‘bp_group_activities_notify_members’, ‘buddydev_mail_on_new_group_activity’, 10, 2 );

  • Participant
    Level: Initiated
    Posts: 7
    arisanz on #36503

    Not working,

    I need to notificate by mail of all the activity in the groups. No only by internal notifications the most impotant is to send an email to every member of the group.