Sender Info on customized Emails doesn't use current Email Default Settings

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
8 years 8 months ago #251605

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6.16

I recently launched a new HikaShop based site after a long development period and ran into problem with an obscure problem/solution.

It was necessary for us to modify four different Email templates to add company logos and custom information displays. What apparently happened is that whenever the custom template was created, the system embedded Sender Information culled from HikaShop's default configuration. Once values were stored in these custom Sender Information fields, they were stored and re-stored even after we transferred the site from the development server to the live machine and updated the HikaShop's Default Email configurations to meet live requirements. We were never aware that those fields had any values at all since we had never deliberately supplied any, and the fields were hidden on the third tab of the Custom Email editing page.

As a result, the live site was sending these four customized emails using the Sender Information lifted from the development site. It took us about a week to track down exactly what was happening.

Under most circumstances, if you leave a configuration field blank, the system will lift default values from HikaShop, but here, if you save the form with these fields being blank, it appears to grab the default values and store them along with the customization. Unless you know to manually erase those field values, it will retain and use the values which were provided originally and will never update them even if you change the default values.

Can this Custom Email form behavior be corrected to utilize HikaShop's default Email values properly, instead of requiring a manual update each time we change the Email Default settings?

Please Log in or Create an account to join the conversation.

  • Posts: 83931
  • Thank you received: 13586
  • MODERATOR
8 years 7 months ago #251635

Hi,

Thank you for your feedback.
Try to add the code:

if(in_array($column, array('from_name', 'from_email', 'reply_name', 'reply_email')) && $config->get($column) == $value){
				$value = '';
			}
after the line:
hikashop_secureField($column);
in the file administrator/components/com_hikashop/classes/mail.php
That should avoid the problem so that if you don't change the email settings, the system won't save them so that if you change the default configuration later, it will be used automatically.
Let us know how it goes, that way, we can add that to the next version.

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
8 years 5 months ago #258293

Hello!

I try this code, but not update the sender info (email config settings):

		hikashop_secureField($column);
			
			if(in_array($column, array('from_name', 'from_email', 'reply_name', 'reply_email')) && $config->get($column) == $value){
				$value = '';
			}
			else{

				$mail->$column = $safeHtmlFilter->clean(strip_tags($value), 'string');
Whats the solution for it?

Thank You!

Merry Christmas!

Last edit: 8 years 5 months ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 26249
  • Thank you received: 4039
  • MODERATOR
8 years 5 months ago #258586

Hi,

Regarding the code you pasted, I am not sure that it is what Nicolas asked ; because there is no mention of any "else".
Please provide more details about your issue.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum