- Posts: 42
- Thank you received: 2
Trigger Order Creation Email from Joomla Article
11 years 4 months ago - 11 years 4 months ago #200722
by GSW00d
Trigger Order Creation Email from Joomla Article was created by GSW00d
-- HikaShop version -- : 2.4.0
Hi Hika Team!
I need to activate the order creation email function from a different page in a custom payment gateway that I've made (all working). I didn't use the normal development guide for payment gateways due to our provider having specific requirements. At the moment the order creation email triggers on the end page on the checkout and not after the redirection. I can disable this, but need to enable an order creation email trigger from a joomla article (I am currently using sourcer to do some other custom code on the payment landing page).
How would I go about doing this?
Hi Hika Team!
I need to activate the order creation email function from a different page in a custom payment gateway that I've made (all working). I didn't use the normal development guide for payment gateways due to our provider having specific requirements. At the moment the order creation email triggers on the end page on the checkout and not after the redirection. I can disable this, but need to enable an order creation email trigger from a joomla article (I am currently using sourcer to do some other custom code on the payment landing page).
How would I go about doing this?
Last edit: 11 years 4 months ago by GSW00d.
Please Log in or Create an account to join the conversation.
11 years 4 months ago #200727
by nicolas
Replied by nicolas on topic Trigger Order Creation Email from Joomla Article
Hi,
I'm not sure if you are creating the order somewhere else and want to send the order creation email at that point, or if you want to have the order creation and the order creation email sending processes done on two different pages.
In the first case, it's really easy. When you call the save function of the class.order model you want to add a parameter $order->history->history_notified = 1; to the $order object so that the email will be sent.
In the second case, you'll want to use such code:
Note that this supposes that you have the $order object with the exact same content as when you create the order so it's going to be more difficult to do than for the first case.
I'm not sure if you are creating the order somewhere else and want to send the order creation email at that point, or if you want to have the order creation and the order creation email sending processes done on two different pages.
In the first case, it's really easy. When you call the save function of the class.order model you want to add a parameter $order->history->history_notified = 1; to the $order object so that the email will be sent.
In the second case, you'll want to use such code:
Code:
$orderClass->loadOrderNotification($order,'order_creation_notification');
$mail = hikashop_get('class.mail');
if(!empty($order->mail->dst_email)) {
$mail->sendMail($order->mail);
}
Please Log in or Create an account to join the conversation.
Time to create page: 0.158 seconds