This was added in a37ff8d. Per the commit message, php_uname() in a
Windows server can sometimes return the string using encondings other
than ISO-8859-1 and thus utf8_encode() was added. The problem is that
utf8_encode() only converts from ISO-8859-1 to UTF-8 so it does not work
for the purpose that it was added and it was deprecated in PHP 8.2.
Removing it seems safe. If we start having problems with character
encoding in the string that we are sending to Helpscout, we can consider
other alternatives to make sure the string is always send using UTF-8.
[MAILPOET-4865]
We are now using the `session-data` method of the Beacon API to send
site information to HelpScout
(https://developer.helpscout.com/beacon-2/web/javascript-api/#beacon-session-data).
This method has a limit of 20 attribute-value pairs and since we had
more, it was necessary to combinte a few values under the same
attribute.
[MAILPOET-4525]
We were calling the wrong Beacon API method to send system info
data to HelpScout when users create tickets inside WordPress. This
commit fixes this by calling the method `session-data` instead of
`identify`. It is likely that `identify` was the correct method in the
past, but the Beacon API changed
(https://developer.helpscout.com/beacon-2/web/javascript-api/).
Nowadays, the `identify` method is used to add data to the HelpScout
users and fields need to be created in advance in the HelpScout web
interface. `session-data` is used to add information to the ticket which
is what we are trying to achieve. Only `name` and `email` should still
be passed to `identify` to make it possible to match the correct
HelpScout user.
[MAILPOET-4525]
This commit adds a new flag to \MailPoet\Helpscout\Beacon::getData() to
mask half of the API key when this method is used to get information for
the System Info page. When it is used to pass information to HelpScout
nothing should change and the full key will be returned.
[MAILPOET-4009]