Jump to content

Change the "FROM" email in "New Order" email


Recommended Posts

Hi there,

I just received a request from my client.
You know how in Gmail, all the email coming from the same email and subject are grouped together...

Well, that's kind of annoying to keep track of the orders and it would be much better if the sender email for the New order was the customer email.

Or maybe, is it possible to change the SUBJECT of the mail to include the customer name and order number? So the confirmation emails shouldn't be grouped?

Any idea how to do that.
I had a look at the mailalerts.php file but I am not sure where to change this parameter.

I thought it would be somewhere here:

if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.html'))
           Mail::Send($id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], NULL, NULL, dirname(__FILE__).'/mails/');




Thanks for your tips!

Link to comment
Share on other sites

All right, at least I managed to change the subject in Mailalerts.php:


$subject = $this->l('New order').' '.$order->id.' '.$this->l('from').' '.$customer->firstname.' '.$customer->lastname;



But if you know how to change the sender email I am still interested.
I know that the contact form of the site does it.

Johanna

Link to comment
Share on other sites

  • 3 months later...

You were pretty close with the first lines. Thanks to your search I got it working to get the mail to be send out the customer. I did the following:

in mailalerts.php line 176, right after the complete declaration of the array $templateVars

$from = $customer->email;
$fromName = ($customer->firstname.' '.$customer->lastname);


then on line 180:

Mail::Send($id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $from, $fromName, NULL, NULL, dirname(__FILE__).'/mails/');


The from field of the mail is now the customer name and contains the email of the customer.
I also putted this on line 135 to put the ordernumber in the subject:

$subject = $this->l('New order: ' . sprintf("d", $order->id));

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...

I'm also trying to figure out how to change the sender for my client's webshop. Now, when a new customer creates an account (probably the same thing with other e-mails, but I haven't tested them yet) and gets the account information by e-mail, there's Firstname Lastname in the sender field. I would like there to be the shop's name. Any tips on how I can change this?

 

EDIT: Never mind. Got it ^_^

Edited by D-bird (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...