Jump to content

Send email_conf to admin insteaf of customer


webrider

Recommended Posts

Good morning,

 

I need to send the automatic confirmation to the admin of the shop, who can then forward it.

 

I understand it is is classes/payment module I have to modify the code below probably the line in bold but I don't know which variable to put instead of customer. Or it is possible to put directly an email address?

 

Mail::Send(
    (int)$order->id_lang,
    'order_conf',
    Mail::l('Order confirmation', (int)$order->id_lang),
    $data,
    $this->context->customer->email,
    $this->context->customer->firstname.' '.$this->context->customer->lastname,
    null,
    null,
    $file_attachement,
    null, _PS_MAIL_DIR_, false, (int)$order->id_shop
);

 

Thank you in adavnce for your help and time!

Link to comment
Share on other sites

Yes, you should be able to just add the admin email address there. Additionally, you could send a sender's email and sender's name (Maybe as an "administrative reminder", you actually could give the customer's email and name here, just as if the customer sent the Email. :-)   ) 

 

(Make backup of the file, just in case)

 

 

Mail::Send(
    (int)$order->id_lang,
    'order_conf',
    Mail::l('Order confirmation', (int)$order->id_lang),
    $data,
    '[email protected]',
    $this->context->customer->firstname.' '.$this->context->customer->lastname,
    null,    <-- If needed, you could add a sender's email address  here
    null,    <-- If needed, you could add a sender's name here
    $file_attachement,
    null, _PS_MAIL_DIR_, false, (int)$order->id_shop
);

 

 

 

Give it a try,

pascal.

Link to comment
Share on other sites

I believe you could also change it to null, which would force Prestashop to use the 'shops' email address defined in the store contacts page.  Assuming the "admin of the shop" has their email address already configured there.

 

Also note, that the mail alerts module is typically used to notify merchants of new orders.  Why would you suppress the customer one?

  • Like 1
Link to comment
Share on other sites

Hi,

I have tried your solution Pascal (thank you!), it does prevent to send to my customer the email_conf (also reached commenting /* the full section)

but I don't receive the emails. I have tried with the email alrt module activated or not.

 

The reason why I want the email_conf + the email alert option (Bellini13)

is because email_conf is more advanced including the pdf (I  beleive I can set this up in another email template)

+

I have to send manually this email because the order is confirmed after a call confirmation, so can't be sent automatically when validating the order. I want it in my inbox ready to send.

I understand I can use a pre order module but I want to limitate them for now.

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