Events
Events are the core concept in this plugin. Each event maps a WooCommerce/WordPress action to a Klaviyo metric or profile update.
Supported events
Order events
| Event class | Klaviyo metric |
OrderPlacedEvent | Placed Order |
OrderRefundedEvent | Refunded Order |
OrderReturnFlow | Return Flow |
Subscription events
| Event class | Klaviyo metric |
SubscriptionCreatedEvent | Subscription Created |
SubscriptionActivatedEvent | Subscription Activated |
SubscriptionCancelledEvent | Subscription Cancelled |
SubscriptionPausedEvent | Subscription Paused |
SubscriptionPauseExtendedEvent | Subscription Pause Extended |
SubscriptionPendingCancelEvent | Subscription Pending Cancel |
SubscriptionStopFlowEvent | Stop Flow |
SubscriptionOffboardingDiscountAdded | Offboarding Discount Added |
SubscriptionTmpOnholdEndingNotificationEvent | Onhold Ending Notification |
SubscriptionUpdatedIdentify | Profile identify (subscription data) |
User / account events
| Event class | Klaviyo metric |
AccountCreatedEvent | Account Created |
UserUpdatedIdentify | Profile identify (user data) |
UserRequestResetPasswordEvent | User Request Reset Password |
DAO / logistics
| Event class | Klaviyo metric |
DaoReturnLabelCreated | Return Label Created |
Event registry
All events are registered via EventRegistry (inc/Events/EventRegistry.php). New events must be added there to be schedulable.
Adding a custom event
- Create a class in
inc/Events/Events/ that extends BaseEvent (or BaseOrderEvent / BaseSubscriptionEvent). - Implement
EventInterface. - Register it in
EventRegistry. - Add a watcher in
inc/Watchers/ that calls EventSchedulerAPI::schedule() on the relevant WC/WP hook.
Forced events
By default, the UNIQUE KEY (event_code, entity_id) prevents the same event from being queued twice for the same entity. Set $scheduledEvent->set_forced(true) to bypass deduplication — the existing row is deleted and replaced. This is useful for recurring status changes (e.g. chargebacks).