[Skip to main content](#vessel-content)

#   Incorrect email subject line when sending wishlist emails

##

- **[speru](/forum/user/26914-speru "View speru's Profile")**
- [![speru's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/26914-speru "View speru's Profile") Topic Author
- [ Offline](/forum/user/26914-speru)

Less More

- Posts: 20
- Thank you received: 1
-
-
- [](https://starwoodsystems.com/)
-

5 years 5 months ago [\#333707](#333707) by [speru](/forum/user/26914-speru "View speru's Profile")  *[Incorrect email subject line when sending wishlist emails](/forum/41-wishlist/902817-incorrect-email-subject-line-when-sending-wishlist-emails#333707 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.27 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : Firefox 90.0b6 -- Error-message(debug-mod must be tuned on) -- : No Error Message  When a wishlist email is sent, the subject line is exactly 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT'.  In the database (hikashop&#95;config table), we have wishlist&#95;share.subject = WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT  In the administrator/components/com&#95;hikashop/classes/mail.php line 78 (loadInfos() function), the 'subject' key is loaded from the config table and saved as $mail-&gt;subject. In our case, this means $mail-&gt;subject is the string 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT'.  loadInfos() is called from get() (line 21 in mail.php).  The get() function, in turn, is called from administrator/components/com&#95;hikashop/classes/cart.php line 4110 (loadNotification() function).  Lines 4111 to 4113 are as follows  To me, this will convert WISHLIST&#95;SHARE&#95;NOTIFICATION&#95;SUBJECT to a string, and add the users' name, users' email and wishlist name only if a) the $mail-&gt;subject is empty (in our case, it is 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT' as defined in the config table) or b) the $mail-&gt;subject is the string 'WISHLIST&#95;SHARE&#95;NOTIFICATION&#95;SUBJECT'  So, in our case, no translation is done, so the subject line remains 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT', irrespective of any overrides we add.  I think line 4111 is not required and lines 4112 and 4113 should be  i.e. if we have read language constant from the config table that is not empty, then do the conversion on the data stored in $mail-&gt;subject.  As an aside, there does not appear to be anywhere on any of the Hikashop configuration pages where you can say what language constant is to be used for the wishlist subject line unless you edit the database directly.")* was created by *[speru](/forum/user/26914-speru "View speru's Profile")*

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.27
-- PHP version -- : 7.4.20
-- Browser(s) name and version -- : Firefox 90.0b6
-- Error-message(debug-mod must be tuned on) -- : No Error Message

When a wishlist email is sent, the subject line is exactly 'WISHLIST_SHARE_EMAIL_SUBJECT'.

In the database (hikashop_config table), we have
wishlist_share.subject = WISHLIST_SHARE_EMAIL_SUBJECT

In the administrator/components/com_hikashop/classes/mail.php line 78 (loadInfos() function), the 'subject' key is loaded from the config table and saved as $mail-&gt;subject. In our case, this means $mail-&gt;subject is the string 'WISHLIST_SHARE_EMAIL_SUBJECT'.

loadInfos() is called from get() (line 21 in mail.php).

The get() function, in turn, is called from administrator/components/com_hikashop/classes/cart.php line 4110 (loadNotification() function).

Lines 4111 to 4113 are as follows Code:

$subject = strtoupper($type).'_NOTIFICATION_SUBJECT'; if(empty($mail-&gt;subject) &#124;&#124; $mail-&gt;subject == $subject) $mail-&gt;subject = JText::sprintf($subject, $data-&gt;user-&gt;name, $data-&gt;user-&gt;user_email, $data-&gt;cart-&gt;cart_name);

To me, this will convert WISHLIST_SHARE_NOTIFICATION_SUBJECT to a string, and add the users' name, users' email and wishlist name only if
a) the $mail-&gt;subject is empty (in our case, it is 'WISHLIST_SHARE_EMAIL_SUBJECT' as defined in the config table)
or
b) the $mail-&gt;subject is the string 'WISHLIST_SHARE_NOTIFICATION_SUBJECT'

So, in our case, no translation is done, so the subject line remains 'WISHLIST_SHARE_EMAIL_SUBJECT', irrespective of any overrides we add.

I think line 4111 is not required and lines 4112 and 4113 should be
Code:

if(!empty($mail-&gt;subject)) $mail-&gt;subject = JText::sprintf($mail-&gt;subject, $data-&gt;user-&gt;name, $data-&gt;user-&gt;user_email, $data-&gt;cart-&gt;cart_name);

i.e. if we have read language constant from the config table that is not empty, then do the conversion on the data stored in $mail-&gt;subject.

As an aside, there does not appear to be anywhere on any of the Hikashop configuration pages where you can say what language constant is to be used for the wishlist subject line unless you edit the database directly.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQxLXdpc2hsaXN0LzkwMjgxNy1pbmNvcnJlY3QtZW1haWwtc3ViamVjdC1saW5lLXdoZW4tc2VuZGluZy13aXNobGlzdC1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

5 years 5 months ago [\#333712](#333712) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Incorrect email subject line when sending wishlist emails](/forum/41-wishlist/902817-incorrect-email-subject-line-when-sending-wishlist-emails#333712 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.27 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : Firefox 90.0b6 -- Error-message(debug-mod must be tuned on) -- : No Error Message  When a wishlist email is sent, the subject line is exactly 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT'.  In the database (hikashop&#95;config table), we have wishlist&#95;share.subject = WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT  In the administrator/components/com&#95;hikashop/classes/mail.php line 78 (loadInfos() function), the 'subject' key is loaded from the config table and saved as $mail-&gt;subject. In our case, this means $mail-&gt;subject is the string 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT'.  loadInfos() is called from get() (line 21 in mail.php).  The get() function, in turn, is called from administrator/components/com&#95;hikashop/classes/cart.php line 4110 (loadNotification() function).  Lines 4111 to 4113 are as follows  To me, this will convert WISHLIST&#95;SHARE&#95;NOTIFICATION&#95;SUBJECT to a string, and add the users' name, users' email and wishlist name only if a) the $mail-&gt;subject is empty (in our case, it is 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT' as defined in the config table) or b) the $mail-&gt;subject is the string 'WISHLIST&#95;SHARE&#95;NOTIFICATION&#95;SUBJECT'  So, in our case, no translation is done, so the subject line remains 'WISHLIST&#95;SHARE&#95;EMAIL&#95;SUBJECT', irrespective of any overrides we add.  I think line 4111 is not required and lines 4112 and 4113 should be  i.e. if we have read language constant from the config table that is not empty, then do the conversion on the data stored in $mail-&gt;subject.  As an aside, there does not appear to be anywhere on any of the Hikashop configuration pages where you can say what language constant is to be used for the wishlist subject line unless you edit the database directly.")*

Hi,

The code modification indeed does make sense so that the subject is properly converted and the variable available, instead of having to change the subject to the translation as per the code.
We'll add that modification on our end. Thanks for the feedback on the issue.
Regarding modifying the subject, in the menu System&gt;Emails, you can edit each email sent by HikaShop, and the first input field there is the subject. When you save that form, it will modify wishlist_share.subject in hikashop_config.

The following user(s) said Thank You: [speru](/forum/user/26914-speru "View speru's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQxLXdpc2hsaXN0LzkwMjgxNy1pbmNvcnJlY3QtZW1haWwtc3ViamVjdC1saW5lLXdoZW4tc2VuZGluZy13aXNobGlzdC1lbWFpbHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.044 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
