Jump to content

Change email from address for order alerts


al_foto

Recommended Posts

Is it possible to change the "from" email address for the copy of the order I receive ?

 

Now it's send from the shop email address but it's very hard to find orders in my inbox if searching by customer email address because I have to look in the email body, therefore I would like to have the customer email addres in the from field or at least in the subject.

 

Thanks.

Link to comment
Share on other sites

I hope I understood which Email you mean, but if you want to have an Email address in the subject of your "Order Confirmation" email, you can Edit the file classes/PaymentModule.php

Find the line

Mail::l('Order confirmation', (int)$order->id_lang),

 

and change into (add to):

Mail::l('Order confirmation', (int)$order->id_lang).'. Order by '.$this->context->customer->email,

 

(don't overlook the 3 periods (".") )

This gives the Customer Email in the subject line, after the Original "[shop name] Order confirmation"

 

Beware that when upgrading your shop needs manually editing this file again (and again...)

 

Hope this helps,

Pascal

  • Like 1
Link to comment
Share on other sites

Thanks for your answer.

 

The order confirmation in PaymentModule.php is sent to the customer if I'm right, but I need that the "New order" email I receive includes the customer email.

I guess this should be in the mailalerts module, will take a look and may be I can apply something like your proposal.

Link to comment
Share on other sites

Other option:

Just see that if you want the sender to be the original customer's Email address you can edit as follows:

close to the changes as decribed in comment above(in the mail::send( ) function ) a few lines under these,

you see a 3 lines

 

null,

null,

$file_attachement,

 

change this into:

null,

$this->context->customer->email,

$file_attachement,...

 

(N.B. the changed parameter should be the 8th parameter of the Send() function, at least in Prestashop 1.5.2)

 

So, you can choose which change you prefer, or do both, to make it all complete :-)

 

Hope this helps,

pascal

 

---------------------------------------------------------

www.PhelineOnline.com

www.KidsAndMum.com

www.ModulesModules.com

  • Like 1
Link to comment
Share on other sites

Done, have changed the line:

 

sprintf(Mail::l('New order - #%06d', $id_lang), $order->id),

 

to

 

sprintf(Mail::l('New order - #%06d', $id_lang), $order->id)." "."by: ".$customer->email,

 

in mailalerts.php in the mailalerts module. Seems to work.

 

Thanks for showing me the way to go ;)

  • Like 1
Link to comment
Share on other sites

1) Make notes (at least of files changed)

2) keep copy of original files (original installation files

3) Do a file compare on the changed files

 

Maybe it helps. I heard that in prestashop 1.5 you can overload functions (i.e. add/change functionality). See developers guides for details, but I understood you can change behaviour without touching the original files, (little bit like themes...)

Edited by PascalVG (see edit history)
Link to comment
Share on other sites

the 'correct' way of making custom changes to modules, is to make a copy of the module, rename it (ie mailalerts to mailalerts2), and then make the changes to the copy. then disable the original module.

 

this way during upgrades you will know that you made a customization, since the upgrade process will warn you of the custom module

  • Like 2
Link to comment
Share on other sites

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...