eMail hook whenn making order - urgent

Open to all! Ask other shopowners for help.
Post Reply
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
Has thanked: 7 times
Been thanked: 3 times

eMail hook whenn making order - urgent

Post by loop »

Hi all
i found a module n_checkout.php
as i need to add a special email from my newsletter provider, i see there is also a hook there: echo $GLOBALS['OSCOM_Hooks']->call('siteWide', 'orderMail', $parameters);
can i use it to hook a second email generation module? how i can get the parameter of the orders i need to process in the email? (orders_id, products he bought...)

thank you for the help!


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: eMail hook whenn making order - urgent

Post by ecartz »

Wouldn't it be easier just to copy the module and edit out the parts that you don't need? You can have as many notification modules per channel as you want. Copy three files to the new name and edit them appropriately.

If you really want to do it with the hook, it passes the order object as $parameters['order'] so you could ->get_id() to get the order ID and ->products to get the products from that.
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
Has thanked: 7 times
Been thanked: 3 times

Re: eMail hook whenn making order - urgent

Post by loop »

ah perfect! you are right, thank you ecartz!


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply