Trigger Order Creation Email from Joomla Article

  • Posts: 42
  • Thank you received: 2
9 years 6 months ago #200722

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

Last edit: 9 years 6 months ago by GSW00d.

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #200727

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:

$orderClass->loadOrderNotification($order,'order_creation_notification');
						$mail = hikashop_get('class.mail');
						if(!empty($order->mail->dst_email)) {
							$mail->sendMail($order->mail);
						}
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum