X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Display company name as Email sender (https://forum.x-cart.com/showthread.php?t=63170)

lcg 04-19-2012 07:56 PM

Re: Display company name as Email sender
 
Quote:

Originally Posted by qualiteam
No, in 4.0.x it is even simpler.

All you need to do is alter the "admin/configuration.php" script and replace this piece of code:
PHP Code:

$trusted_post_variables = array("gpg_key""pgp_key"); 


with this:
PHP Code:

$trusted_post_variables = array("gpg_key""pgp_key""site_administrator""users_department""orders_department""support_department""newsletter_email"); 



Hi Qualiteam,

Thanks for the information, I really missed some of the threads and just noticed that it was meant for the newsletter mailing, sorry about that :|

Is there a way we can make this to work with customer order notifications and all other e-mails pertaining to ordering so that the email sender's name is displayed with the store's email? (sorry if off-topic, but similar :))

hoosierglass 04-20-2012 07:41 AM

Re: Display company name as Email sender
 
lcg it does work for all emails.

Q-Team is this possible to do in Version 4.3.2 ? I tried to adapt it but it would not take the new style of entry in the Company email fields.

lcg 04-20-2012 10:27 AM

Re: Display company name as Email sender
 
Quote:

Originally Posted by hoosierglass
lcg it does work for all emails.

Q-Team is this possible to do in Version 4.3.2 ? I tried to adapt it but it would not take the new style of entry in the Company email fields.


Thanks Hoosierglass :-)

One question, in General Settings > Company Options, for orders and department emails, should I use this type of formatting?

My Business Name <info@mybusinessname.com>

hoosierglass 04-20-2012 11:05 AM

Re: Display company name as Email sender
 
Yes, once you make the MODs, then you can go into general settings, company and you will change all of the company email settings to that format but on the company "from" email you will leave that as is.

I have tested this in 4.4.3 and it works like a charm. I still need to figure out 4.3.2.

lcg 04-21-2012 01:14 AM

Re: Display company name as Email sender
 
Quote:

Originally Posted by hoosierglass
Yes, once you make the MODs, then you can go into general settings, company and you will change all of the company email settings to that format but on the company "from" email you will leave that as is.

I have tested this in 4.4.3 and it works like a charm. I still need to figure out 4.3.2.


In 4.0.18 I do not see a "from" email in General settings > Company options, I have:

Users department e-mail address
Site administrator e-mail address
Orders department e-mail address
Help/Support department e-mail address
Replay-To newsletter email address

I did try a test order and mail seems to display properly upon arrival, thanks for helping me out with this 4.0.18 mod and good luck testing it on 4.3.2, perhaps someone with that version will be of help, thanks again hossier. One thing I did notice that when one responds back to one of the emails, as a test customer the company name is not parsed to the e-mail client, just the email address is displayed, hope this helps someone using 4.0.18.

qualiteam 04-23-2012 12:20 AM

Re: Display company name as Email sender
 
I've checked 4.3.x code, the changes should be similar to the ones for 4.4.x.

qualiteam 05-02-2012 03:09 AM

Re: Display company name as Email sender
 
The updated email format can possible cause issues in connection with X-Payments since it has default validation rules for emails. Like this thread.

I'll check what can be done to avoid this and update this thread soon.

qualiteam 05-29-2012 01:17 AM

Re: Display company name as Email sender
 
To make the mod working correctly with X-Payments, a slight additional modification is required.

Alter the "modules/XPayments_Connector/xpc_func.php" script and add new code:

PHP Code:

$email_matcher "/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z](?:[a-z0-9-]*[a-z0-9])/";

if (
    
preg_match($email_matcher$result['merchantEmail'], $xpc_ematches)
    && isset(
$xpc_ematches[0])
) {
    
$result['merchantEmail'] = $xpc_ematches[0];



at the end of the xpc_prepare_cart function as follows:

PHP Code:

function xpc_prepare_cart($cart$refId$force_auth)
{
.....................................................
        
$result['merchantEmail'] = $admin_email;

    }

    
$email_matcher "/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z](?:[a-z0-9-]*[a-z0-9])/";

    if (
        
preg_match($email_matcher$result['merchantEmail'], $xpc_ematches)
        && isset(
$xpc_ematches[0])
    ) {
        
$result['merchantEmail'] = $xpc_ematches[0];
    }

    return 
$result;



Raptor 07-27-2012 09:41 PM

Re: Display company name as Email sender
 
doesn't work with 4.5.1

get error saying

Invalid data entered into the field 'SMTP "MAIL FROM" email address'

qualiteam 07-30-2012 11:48 PM

Re: Display company name as Email sender
 
OK, I see there were no support for smtp mail from option.
I've updated the instructions, please check.


All times are GMT -8. The time now is 05:15 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.