Page 1 of 1

Customer e-mails are always sent in default language

Posted: Thu Nov 28, 2024 2:42 pm
by Cegri
Version of script: 3.5.1
Hosting company: Hetzner
What terms did you try when SEARCHING for a solution:
HESK reply email correct language new_ticket.txt

Write your message below:

I'm experimenting with Hesk multilingiual setup. Have Turkish and English installed, English as default.

The following are working;
  • Language selection at the Submit Ticket Form (...com/index.php?language=Türkçe&a=add)
  • Confirmation page also in Turkish.
  • Team member receives new_ticket_staff mail according to his profile language (irrespective of language used by customer.)
  • The ticket is automatically set to the correct language. (Observable at ...com/admin/edit_post.php?track=A4...)
However;
  • The customer always receives the new_ticket mail in the default language.
  • new_reply_by_staff is also received in the default language, irrespective of the language setting of the ticket.
Is this the expected behaviour, or am I missing something?

Re: Customer e-mails are always sent in default language

Posted: Fri Nov 29, 2024 8:24 pm
by Klemen
No, this is not the correct behavior. It used to work correctly, but perhaps the 3.5.x update caused the issues.

I will investigate and prepare a fix if I can reproduce the issue.

Re: Customer e-mails are always sent in default language

Posted: Fri Nov 29, 2024 8:26 pm
by Klemen
Could you also confirm what your "Customer Accounts" setting is in Admin panel > Settings > Help desk please?

Re: Customer e-mails are always sent in default language

Posted: Fri Nov 29, 2024 8:46 pm
by Cegri
The Customer Accounts are disabled.

In the meantime I have looked into the code.

In inc\email_functions.inc.php, function hesk_notifyCustomer, line 49;

Code: Select all

       // Make sure customer gets response in correct language
        $language = isset($customer['language']) ? $customer['language'] : HESK_DEFAULT_LANGUAGE;
I understand it is expected to get the language info from the Customers table. But that field does not seem to exist.

In any case; If the customer accounts are not used, the mail should be sent in the ticket's language.

Re: Customer e-mails are always sent in default language

Posted: Fri Nov 29, 2024 8:54 pm
by Klemen
Agreed. I verified this, and it is indeed a bug in 3.5.x, it worked well before.

Will be fixed in 3.5.2, thanks for reporting.

Re: Customer e-mails are always sent in default language

Posted: Sat Nov 30, 2024 11:17 am
by Cegri
The following tweak worked for me:

Code: Select all

...
 // Make sure customer gets response in correct language
        if (isset($customer['language']))
        {
            $language = $customer['language'];
        }elseif ( isset($ticket['language']) )
        {
            $language = $ticket['language'];
        }
        if (!isset($language)) {
            $language = HESK_DEFAULT_LANGUAGE;
        }

        if (!isset($language)) {
            $language_to_customers[$language] = [];
        }
        $language_to_customers[$language][] = $customer;
    }
   ...

Re: Customer e-mails are always sent in default language

Posted: Mon Dec 02, 2024 8:34 pm
by Klemen
Thanks for sharing. We'll need to look into it a bit deeper because in some cases the language setting isn't added to the profile. Should be fully fixed in 3.5.2