• Hi,

    i have a problem with your plugin. All digest email doesn’t works and i have some difficulties to find the solution.

    for debug, i want to send an email for one user. is it possible to sent for one user ?

    for example i have this code :

      $timestamp = '2024-07-01 07:00:00';
    $activity_id = 14808;
    $group_id = 136;
    $user_id = 712; // contact_id 15718
    $is_preview = false;

    $type = 'dig'; // 'sum' or 'dig'
    function group_activities_id($user_id,$type,$timestamp) {
    $query = new BPGES_Queued_Item_Query( array(
    'user_id' => $user_id,
    'type' => $type,
    'before' => $timestamp,
    ) );

    $items = $query->get_results();

    // Sort by group.
    $sorted_by_group = array();
    foreach ( $items as $item ) {
    if ( ! isset( $sorted_by_group[ $item->group_id ] ) ) {
    $sorted_by_group[ $item->group_id ] = array();
    }

    $sorted_by_group[ $item->group_id ][] = $item->activity_id;
    }

    // Ensure numerical sort.
    foreach ( $sorted_by_group as $group_id => &$group_activity_ids ) {
    sort( $group_activity_ids );
    }

    return $group_activity_ids;
    }
    function bpges_generate_notification($activity_id, $group_id, $user_id)
    {
    // Fetch group subscription.
    $sub = new BPGES_Subscription_Query(array(
    'user_id' => $user_id,
    'group_id' => $group_id,
    'per_page' => 1
    ));
    $sub = $sub->get_results();
    $sub = end($sub);

    ...
    }
    function bpges_generate_digest($user_id, $type, $is_preview,$timestamp)
    {
    $group_activity_ids = group_activities_id($user_id,$type,$timestamp);

    ...
    }

    Thanks

  • You must be logged in to reply to this topic.