Skip to content

How we able to use sendEvent? #42

@jack-fdrv

Description

@jack-fdrv

I am wondering why there is no example how to use this sdk?
What approach should I use to be successful with this sdk?

For example here is my code

public function sendEvent( $event_name, $customer_email, $customer_properties = array(), $properties = array() ) {
        $eventData = [
            'data' => [
                'type' => 'event',
                'attributes' => [
                    'event' => $event_name,
                    'profile' => ['$email' => $customer_email] + $customer_properties,
                    'properties' => $properties,
                ],
            ],
        ];
        
        $event = new KlaviyoAPI\Model\EventCreateQueryV2( $eventData );  
        $resp = $this->client->Events->createEvent($event);
}

to use createEvent i need to first create an object of event via some weird EventCreateQueryV2 but there is no example of data structure... How can i do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions