How to prevent thread.replies from triggering if a sender responds to it's own thread?

I am transitionning to Nylas V3.

In my V2 implemention of the thread.replied webhook, I had to check if the reply was triggered by the sneder or by the recipient doing this:

        $data = json_decode($request->getContent());
        $deltas = $data->deltas[0];
        $threadId = $deltas->object_data->metadata->thread_id;
        $logger->warning('We received a response for Thread ID: ' . $threadId);

        // from_self value will be set to true when a user replies to their own thread.
        //Therefore not accounted as an answer
        if ($deltas->object_data->metadata->from_self || $deltas->object_data->metadata->from_self == "true") {
            $logger->warning('Thread ID: ' . $threadId . ' was not paused because it was responded from it\'s on sender.');
            return new JsonResponse(null, 200);
        }

I cannot find a from_self field in the thread.replied webhook response, What should I do about that?

Many thanks

Hello @Yohann Let me ask and will come back to you :slight_smile:

1 Like

Hello, any news on this?

Thank you