WooCommerce name-day integration
Build a daily WooCommerce job that reads Synaxar’s name-day feed, finds matching customer accounts and hands eligible contacts to your marketing platform.
Store the celebration name in WooCommerce
This setup uses a custom WordPress plugin. Let signed-in customers choose a calendar and the name they celebrate, then save the key as customer metadata. For example, the Greek calendar key for Γιώργος is el:giorgos.
Use the saved customer metadata to identify eligible accounts. Ask for the preferred observance when a name has several dates.
Fetch the feed with Action Scheduler
- Register a recurring Action Scheduler hook that runs after midnight in the calendar’s time zone. Keep one recurring action per calendar.
- In the callback, fetch the public feed once. Stop the run on HTTP or JSON errors so the job can be retried.
- Compare the returned keys with your customer metadata. Hand eligible matches to your CRM or email tool and record each customer and feed date after the handoff.
Put this feed request inside the scheduled callback.
$response = wp_safe_remote_get('https://synaxar.com/api/portal/el/today', array('timeout' => 8));
if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {
throw new RuntimeException('Synaxar feed unavailable');
}
$day = json_decode(wp_remote_retrieve_body($response), true, 512, JSON_THROW_ON_ERROR);
$keys = array_column($day['celebrants'], 'key');