WordPress
When you use wordpress with our without woocommerce we few interesting things you can use.
WooCommerce Order Context
After each order being created on WooCommerce we send an event to Flashy with all the order details that has been created.
{
"billing": {
"email": "billing@user.com",
"city": "New York City",
"address": "Homelake 1567"
},
"shipping": {
"email": "billing@user.com",
"city": "New York City",
"address": "Homelake 1567"
}
}
API Access
When you install our WordPress plugin you have access to the API Wrapper and can use all our API endpoints, there is no need to add API KEY if you add it on the WordPress admin panel.
Create Contact From API Access
If you need to create contact (without subscribing them to a list) you can use this function:
- All contact properties can be added to the contact (phone, address, etc..)
flashy()->api->contacts->create(array(
"first_name" => "Steve",
"last_name" => "Jobs",
"email" => "steve@apple.com"
), false);
Create Contact With List Subscription
If you need to create contact + subscribe them to a list you can use this function:
- All contact properties can be added to the contact (phone, address, etc..)
$list_id = 100; // The list ID to subscribe contact to
flashy()->api->lists->subscribe($list_id, array(
"first_name" => "Steve",
"last_name" => "Jobs",
"email" => "steve@apple.com"
), false);
Tracking Custom Event
If you need to send custom event on a contact profile you can simply do it with this function:
$account_id = 150; // Account ID
$email = "steve@apple.com"; // The contact email address
$event = [
"event_name" => "CanBeAnything",
"context" => [
"key" => "value"
],
];
flashy()->api->thunder->track($account_id, $email, "CustomEvent", $event);