Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to change the FROM name when xcart sends emails

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-07-2006, 12:15 PM
  Raptor's Avatar 
Raptor Raptor is offline
 

Senior Member
  
Join Date: Jan 2006
Posts: 131
 

Default How to change the FROM name when xcart sends emails

my xcart sends emails from sales@shopneo.co.uk

however in gmail the name from comes up as "sales"

looks a bit ambigous and not very professional so where to hard code for the name title to be from "Neo Sales" for example

same for all email accounts including newsletters - thanks in advance
__________________
X-Cart Gold Plus v4.7.12
ReBOOT ReDUX Theme
Reply With Quote
  #2  
Old 08-07-2006, 10:04 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default

I haven't tested this, but hopefully this will work, or at least lead you in the right direction. It will change all email to be from your company name, but the reply address will stay as orders, newsletter etc. Just replace YOUR COMPANY NAME below.

In func.php find
Code:
function func_send_mail

If you are using HTML there is a line that sets the email addresses. Try this:

Replace:

Code:
$headers = "From: ".$m_from.$lend."X-Mailer: PHP/".phpversion().$lend."MIME-Version: 1.0".$lend.$message_header;

Code:
$headers = "From: YOUR COMPANY NAME HERE<".$m_from.">\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n"
Reply With Quote
  #3  
Old 08-08-2006, 02:12 AM
  Raptor's Avatar 
Raptor Raptor is offline
 

Senior Member
  
Join Date: Jan 2006
Posts: 131
 

Default

I'll give it a try - thanks a lot !
__________________
X-Cart Gold Plus v4.7.12
ReBOOT ReDUX Theme
Reply With Quote
  #4  
Old 08-08-2006, 03:13 AM
  Raptor's Avatar 
Raptor Raptor is offline
 

Senior Member
  
Join Date: Jan 2006
Posts: 131
 

Default

after edit the site wouldnt even load - i just got a blank screen ?
__________________
X-Cart Gold Plus v4.7.12
ReBOOT ReDUX Theme
Reply With Quote
  #5  
Old 08-08-2006, 06:45 AM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default

Sorry. Forgot to add the closing semi-colon. Try this, I tested this and it worked on version 4.0.14.

Change the line to this:
Code:
$headers = "From: YOUR COMPANY NAME<".$m_from.">".$lend."X-Mailer: PHP/".phpversion().$lend."MIME-Version: 1.0".$lend.$message_header;
Reply With Quote
  #6  
Old 08-08-2006, 01:08 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default

That method will alter the from name for all emails sent even if the from is supposed to be the customer. The biggest problem areas will be GC's, send to a friend and wishlist. Contact emails will be a problem too. If you reply to the customer they will get a reply email that will show as from their name but with your company email address. Try this instead. Still in func_send_mail just a couple of lines earlier find this:

Code:
$m_from = $from;
and replace it with this:
Code:
switch ($from) { case $config["Company"]["users_department"]: case $config["Company"]["site_administrator"]: case $config["Company"]["orders_department"]: case $config["Company"]["support_department"]: case $config["Company"]["newsletter_email"]: $m_from = $config["Company"]["company_name"].'<'.$from.'>'; break; default: $m_from = $from; }
This uses the company name from the admin configuration for the email display name.

Works on 4.0.14 and 4.0.18 and probably most any 4.0 or 4.1 version.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #7  
Old 08-09-2006, 04:58 AM
  Raptor's Avatar 
Raptor Raptor is offline
 

Senior Member
  
Join Date: Jan 2006
Posts: 131
 

Default

brilliant - works great

thanks geckoday
__________________
X-Cart Gold Plus v4.7.12
ReBOOT ReDUX Theme
Reply With Quote
  #8  
Old 08-09-2006, 09:26 AM
 
tahirfayyaz tahirfayyaz is offline
 

Senior Member
  
Join Date: May 2006
Posts: 125
 

Default

Where is func.php
I cant find it

Thanks

Tahir
__________________
Tahir
X-Cart Gold v4.4.4 [win]
Reply With Quote
  #9  
Old 08-09-2006, 09:33 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default

In 4.1 func.php has been broken up into a bunch of smaller files in the include/func directory. You should be looking for func.mail.php
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #10  
Old 08-09-2006, 09:44 AM
 
tahirfayyaz tahirfayyaz is offline
 

Senior Member
  
Join Date: May 2006
Posts: 125
 

Default

I have changed it but still no luck

Where do I change company name to appear in email from field?
__________________
Tahir
X-Cart Gold v4.4.4 [win]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:40 AM.

   

 
X-Cart forums © 2001-2020