public function createInvitationTimelineEntries(EntityPublishedEvent $published_event): void
    {
        // Only act on event objects.
        $event = $published_event->getObject();
        if (!$event instanceof Event) {
            return;
        }

        // Get the author for the event.
        $author = $this->user_provider->loadUserByUsername($event->getAuthor());

        // Create components for this action.
        $event_component = $this->action_manager->findOrCreateComponent($event);
        $author_component = $this->action_manager->findOrCreateComponent($author);

        // Add timeline entries for each group.
        foreach ($event->getGroups() as $group) {
            foreach ($event->getInvitations() as $invitation) {
                $invitee = $this->user_provider->loadUserByUsername($invitation->getInvitee());
                $invitee_component = $this->action_manager->findOrCreateComponent($invitee);

                // Create the action and link it.
                $action = $this->action_manager->create($author_component, 'invited', [
                    'directComplement' => $invitee_component,
                    'indirectComplement' => $event_component,
                ]);

                // Update the action.
                $this->action_manager->updateAction($action);
            }
        }
    }