WooCommerce
Sync every customer who checks out into a Customers list.
No-code⏱ 5 min
Follow up buyers with receipts, win-backs and offers — every WooCommerce checkout lands in your Customers list.
- 1Open
functions.phpas in the WordPress guide. - 2Paste the hook below — it runs when WooCommerce creates a customer at checkout.
- 3Place a test order — the buyer lands in your Customers list.
functions.php — on new customer
add_action('woocommerce_created_customer', function ($customer_id) {
$u = get_userdata($customer_id);
wp_remote_post('https://app.postlys.com/api/v1/contacts', [
'headers' => ['X-Api-Key' => 'pl_live_xxx'],
'body' => [
'email' => $u->user_email,
'name' => $u->first_name . ' ' . $u->last_name,
'list' => 'Customers',
],
]);
});
Ready to try it? Spin up a workspace and grab your key.