=== RedFoX HeyFox – Live Chat & Shared Inbox ===
Contributors: redfoxbusiness
Tags: live chat, chat, fluentcrm, customer support, activecampaign
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.7.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live chat for your website that knows your customers – with FluentCRM, FluentBooking and FluentCommunity data right in the conversation.

== Description ==

**HeyFox is the live chat for WordPress that knows your customers.** Your visitors chat with real people on your site – and your team sees right in the conversation who they are: FluentCRM tags and lists, FluentBooking appointments, FluentCommunity spaces and courses.

Instead of "Visitor #…", your team sees the member, the customer or the person who booked yesterday – and can act on it without leaving the chat: add a FluentCRM tag that starts an automation, send a booking link, see when the appointment is booked.

= Why people use HeyFox =

* **Know who you are talking to:** logged-in members and known contacts appear with their name and CRM data.
* **Act from the chat:** FluentCRM tags set in the chat start your automations as if they had been set in FluentCRM.
* **No lost leads:** visitors who leave an email address are added to FluentCRM – as transactional contacts, no marketing consent assumed.
* **One clean inbox:** website chat and email in one tidy interface – with live visitors, automatic greetings and canned replies. Reply from your desk or from your phone: the web app sends push notifications to iPhone and Android. Facebook Messenger and Instagram are coming soon.
* **Lightweight:** one small script (about 24 KB compressed), loaded asynchronously in the footer so it never blocks your page. No jQuery, no extra stylesheet, no extra database tables.
* **Privacy built in:** hosted in Switzerland, no cookies in the chat window, visitors' IP addresses are not stored.
* **Set up in a minute:** one field – the website ID from your HeyFox inbox.

Your visitors talk to people – HeyFox is not a chatbot.

= What you need =

**A HeyFox account.** HeyFox is a paid service – try it free for 14 days, no card needed. The trial ends on its own, at no cost. Details and prices at [heyfox.chat](https://heyfox.chat). The plugin itself has no locked features.

= What the plugin does =

* Adds the HeyFox chat bubble to every page of your site.
* Recognises logged-in users (optional) – useful for academies, member areas and online courses.
* Shows FluentCRM tags and lists, FluentBooking appointments and FluentCommunity spaces and courses of a visitor directly in the HeyFox inbox.
* Lets your team add FluentCRM tags from the chat.
* Adds chat visitors who leave an email address to FluentCRM (status "transactional", tag "HeyFox-Chat").
* Booking cards: your team sends a FluentBooking link in the chat, and HeyFox shows when the visitor has booked, rescheduled or cancelled.

FluentCRM, FluentBooking and FluentCommunity are optional. Without them, the plugin simply adds the chat to your site.

**ActiveCampaign:** connect it directly in your HeyFox account – no plugin needed. As soon as a visitor gives their email address in the chat, you see their tags and lists. More CRM and email marketing integrations are coming soon.

= Two sites, one CRM =

Many businesses run their website and their member area or CRM on two WordPress installs. HeyFox handles this with two kinds of keys:

* **Connection key (hfc_…)** on the site with FluentCRM – this site is the data source.
* **Login key (hfi_…)** on further sites with a login – it only recognises logged-in users and gives HeyFox no access to data on that site.

A hacked public website can therefore never open your CRM.

== External services ==

This plugin connects your site to HeyFox, a live chat service operated by RedFoX Business Solutions BV, Bruges, Belgium. Nothing is sent before you enter a website ID in Settings → HeyFox.

**Chat script (widget.heyfox.chat)**
Once a website ID is saved, every page loads the chat script from `https://widget.heyfox.chat/v1/heyfox.js`. The chat window then connects to `https://api.heyfox.chat`. It transmits the messages a visitor writes, the address and title of the page they are on (including campaign parameters such as UTM), the referring page, the browser language and a random visitor ID kept in the browser's local storage. The chat window sets no cookies. HeyFox does not store visitors' IP addresses.
If "Recognise logged-in users" is switched on in the plugin, the name and email address of logged-in users are passed on as well, signed with your key.
Further recognition options can be switched on in your HeyFox account (chat window settings → "Recognise visitors"); all are off by default:

* Forms: the email address of a form the visitor submits on your site (e.g. a newsletter sign-up).
* Links from emails: an ActiveCampaign contact ID in the link parameter `?sid=`, or – via the plugin's endpoint `/wp-json/heyfox/v1/whoami` – the FluentCRM contact who clicked a link in one of your FluentCRM emails. The endpoint only answers requests from your own site and its subdomains.

**CRM bridge (api.heyfox.chat → your site)**
If you enter a connection key, HeyFox asks your site for what it knows about a visitor's email address (WordPress user, FluentCRM contact with tags and lists, FluentCommunity spaces and courses) and may add a contact, set tags or write the "HeyFox: last chat" date. Every request is signed with your key and checked by the plugin; without a valid key your site answers nothing.

**Booking status (your site → api.heyfox.chat)**
When a visitor books, reschedules or cancels a FluentBooking appointment that came from a HeyFox chat card, the plugin sends the booking's status, email address, name, event title, start time and time zone to `https://api.heyfox.chat/v1/wp/booking`. Other bookings are never sent.

HeyFox runs its application, database and encrypted backups on its own infrastructure at Infomaniak in Switzerland.

* Terms of use: https://heyfox.chat/nutzungsbedingungen/
* Privacy policy: https://heyfox.chat/datenschutz/
* Security & data protection overview: https://heyfox.chat/sicherheit-datenschutz/

== Installation ==

1. Install and activate the plugin.
2. In your HeyFox inbox, go to Settings → Workspace → Setup & integrations and copy your website ID (hf_…).
3. In WordPress, go to Settings → HeyFox, paste the website ID and save. The chat bubble now shows on your site.
4. Optional: tick "Recognise logged-in users" and paste the connection key (on the site with FluentCRM) or the login key (on further sites).

== Frequently Asked Questions ==

= Do I need a HeyFox account? =

Yes. The plugin connects your site to HeyFox; the chat itself runs on the HeyFox service. You can start a free 14-day trial at [heyfox.chat](https://heyfox.chat) – no card needed.

= Does it work without FluentCRM? =

Yes. Without FluentCRM, FluentBooking or FluentCommunity the plugin adds the chat to your site, and logged-in users can still be recognised. With ActiveCampaign, HeyFox connects directly in your HeyFox account.

= Does it work with my cookie banner? =

The chat window sets no cookies and loads no third-party resources. If your consent tool should still control the script, use the filter `heyfox_script_attributes`, for example:

`add_filter( 'heyfox_script_attributes', function ( $attributes ) {
    $attributes['type'] = 'text/plain';
    $attributes['data-category'] = 'functional';
    return $attributes;
} );`

To switch the chat off on certain pages, return `false` from the filter `heyfox_enabled`.

= Can I remove "Chat by HeyFox"? =

Yes, in your HeyFox inbox under the chat window settings, at no extra cost. The plugin itself adds no credits or links to your site.

= Is there a data processing agreement? =

Yes. You can accept the data processing agreement (GDPR Art. 28) digitally in the HeyFox app and download it as a PDF.

== Screenshots ==

1. The chat window on a website.
2. The HeyFox inbox with FluentCRM data next to the conversation.
3. Plugin settings in WordPress.

== Changelog ==

= 1.7.3 =
* Readme: free 14-day trial instead of the former pilot phase.
* German: “Posteingang” instead of “Postfach”, as in the HeyFox app.

= 1.7.2 =
* New plugin name: RedFoX HeyFox – Live Chat & Shared Inbox.

= 1.7.1 =
* Security: the endpoint for contacts from FluentCRM email clicks only answers your own site and its subdomains, as determined by the browser. Domains such as example.co.uk and other.co.uk no longer count as one site.

= 1.7.0 =
* Available in the WordPress.org plugin directory. Updates now come from WordPress.org.
* English base language; German included.
* The chat script is now added the WordPress way (async, in the footer). The filter `heyfox_script_attributes` works as before.
* Requires WordPress 6.3 or later.

= 1.6.0 =
* Recognises visitors who clicked a link in a FluentCRM email (switch "Recognise contacts from email clicks" in the HeyFox inbox) – also on a subdomain of the same site.

= 1.5.1 =
* HeyFox can pass its own tags and a source when it adds a contact.

= 1.5.0 =
* Website and member area on two WordPress sites: HeyFox asks the site you set as data source (FluentCRM, FluentBooking, FluentCommunity), no matter on which site the visitor chats.
* One field, two kinds of keys: connection key (hfc_…) only on the site with FluentCRM, login key (hfi_…) for further sites with a login. Sites without a login need no key.
* Stronger signature (content + one-time nonce) for new connection keys; older keys keep working.
* "Test connection" in the HeyFox inbox; FluentCRM field "HeyFox: last chat" for confirmed contacts.

= 1.4.1 =
* Version number on the settings page; hints point to the new areas in the HeyFox inbox.

= 1.4.0 =
* Updates directly in WordPress.

= 1.3.0 =
* FluentBooking card in the chat, with a notice when an appointment is booked, rescheduled or cancelled.

= 1.2.0 =
* Set tags from the chat, greetings by FluentCRM tag, campaign source (UTM) in the visitor profile.

= 1.1.1 =
* Renamed "secret" to "connection key".

== Upgrade Notice ==

= 1.7.1 =
Security fix for recognising contacts from FluentCRM email clicks. From now on, updates come from the WordPress.org plugin directory; your settings stay as they are.

= 1.7.0 =
From now on, updates come from the WordPress.org plugin directory. Your settings stay as they are.
