<?php

function smarty_function_helpscout_beacon_identity()
{
    $admin = getAdminUser();

    return json_encode([
        'name' => $admin['name'] ?? $admin['login'],
        'email' => $admin['email'],
        'company' => getShopUniqueName(),
        'signature' => hash_hmac(
            'sha256',
            $admin['email'],
            'MjodsaAdWfVlVXSiOnas0qgE7CQzbRrdjTEEXLR0RUY='
        ),
    ]);
}
