<?php

/**
 * Helper functions for syncing WooCommerce data with Hub.
 *
 * @package northmill-online-shared
 */
namespace Northmill_Online_Shared_Sync\Northmill_Online_Shared\Helpers;

defined('ABSPATH') || exit;
/**
 * WC_Data_Sync_Helpers class
 */
class WC_Data_Sync_Helpers
{
    /**
     * Update WooCommerce email address.
     *
     * @param string $option_name Option name.
     * @param string $email       Email address.
     *
     * @return void
     *
     * @used Northmill Express Order
     */
    public static function set_wc_email(string $option_name, string $email): void
    {
        $opt = get_option($option_name);
        if ($opt) {
            $opt['recipient'] = $email;
            update_option($option_name, $opt);
        }
    }
}
