Page 1 of 1

eMail hook whenn making order - urgent

Posted: Tue Jul 12, 2022 1:25 pm
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!

Re: eMail hook whenn making order - urgent

Posted: Tue Jul 12, 2022 2:18 pm
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.

Re: eMail hook whenn making order - urgent

Posted: Tue Jul 12, 2022 3:18 pm
by loop
ah perfect! you are right, thank you ecartz!