[Skip to main content](#vessel-content)

#   Sending customer email when updating order status

##

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago [\#293455](#293455) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293455 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")* was created by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")*

-- HikaShop version -- : 3.4
-- Joomla version -- : 3.8.8
-- PHP version -- : 5.6
-- Error-message(debug-mod must be tuned on) -- : No errors
Code:

$orderId = 20421; $orderClass = hikashop_get('class.order'); $fullOrder = $orderClass-&gt;loadFullOrder((int)$orderId, true, false); $orderObj = new stdClass(); $orderObj-&gt;order_status = "shipped"; $orderObj-&gt;order_id = $fullOrder-&gt;order_id; $orderObj-&gt;history = new stdClass(); $orderObj-&gt;history-&gt;history_notified = 1; $orderClass-&gt;save($orderObj);

I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history).
If I change it manually through the shop then it works when I tick (notify customer).

Any advice?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

8 years 5 months ago [\#293460](#293460) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293460 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hello,

Can you check that the "Order status notification" email is published via "Hikashop-&gt;System-&gt;Emails" ?

Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago [\#293485](#293485) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  Replied by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293485 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hello

Yeap it is published. Emails work fine when setting the status manually but not through the php script.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

8 years 5 months ago -  8 years 5 months ago [\#293514](#293514) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293514 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hello,

Can you check that your order have switch to a **confirmed status** ?
If not, maybe the issue **isn't starting with Email processing** but with **Payment method** or **Order status** configuration or the way you process your test (like a payment method isn't able to switch status on localhost or else...)

The logical chain is like this :
**1°** Payment servers send **notifications** **=&gt; 2°** Payment method **switch** the order status (if configuration fit this and order had succeed) **=&gt; 3°** HikaShop **switch** the Order statuts =&gt; **Email is sent**.

Hope this will help you to move forward.
Regards

Last edit: 8 years 5 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago -  8 years 5 months ago [\#293529](#293529) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  Replied by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293529 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hello,

Thank you for the reply
I'll explain a bit more on the process at the moment.

Order gets created and updates to 'Confirmed' when paid for (all works fine, emails are sent etc..)
Plugin is hooked on onAfterOrderUpdate and gets the orderId and cURL posts it to another script (script pulls full order, formats a new object to how I need it with the order details and posts it off site) **Does not make any changes or updates to the order**

Another script is setup to basically update the orders status:
It loads the full order and makes a change to the status if required.

Everything works perfectly fine, script changes order status to 'Shipped' - adds tracking ID to the history etc all updates and reflects on the system.

The only thing it is not doing is sending the email to say 'You're order is now shipped' etc.

// Edit

Just to add to this, the hikashop_history table is updating correctly, showing new_status = shipped and notified = 1

Thanks

Last edit: 8 years 5 months ago by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

8 years 5 months ago -  8 years 5 months ago [\#293532](#293532) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293532 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hi,

Ok, so do you get the email that should be sent in the "Customer&gt;Emails history" section of the shop ?
Also, in the trigger onAfterOrderUpdate, the second parameter $send_email can be set to false to prevent the sending of the notification.
So make sure that you're not doing that.
In fact, you could even force that variable to true in order to see if you correctly get the email or not.

Last edit: 8 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago [\#293571](#293571) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  Replied by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293571 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hello,

There are no entries in the Emails History for that order (for the status modification) the normal create/confirmed are there but not my update.
$send_email is not used at all in the plugin, so I assume default of true?.
I'll try and force it to true.

Is there any manual way I can send the email? I have read some threads about the mail class and loading a notification?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

8 years 5 months ago [\#293587](#293587) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293587 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hi,

Default is the value of $orderObj-&gt;history-&gt;history_notified, and any plugin integrating with onAfterOrderUpdate can change it.

You should be able to use something like that: Code:

$orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;loadNotification((int)$order_id, 'order_status_notification'); $mailClass = hikashop_get('class.mail'); $mailClass-&gt;sendMail($order-&gt;mail);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago -  8 years 5 months ago [\#293597](#293597) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  Replied by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293597 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Also just to clarify, this can be ran from an external script which is loading the Joomla framework &amp; the Hikashop helpers?.
The actions I am taking on updating the order etc do not happen **within** a plugin, it is external.

Last edit: 8 years 5 months ago by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

8 years 5 months ago [\#293605](#293605) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293605 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hi,

As long as you load joomla and HikaShop properly before, it should work fine yes.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago -  8 years 5 months ago [\#293645](#293645) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  Replied by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293645 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hello,

I have noticed that when I put the -&gt;sendMail code inside the plugin it works and sends two emails! (Don't really understand why two).
Code:

&lt;?php define('_JEXEC', 1); define('JPATH_BASE', '../../../'); require_once JPATH_BASE . 'includes/defines.php'; require_once JPATH_BASE . 'includes/framework.php'; $app = JFactory::getApplication('site'); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;

Is this all I need to work with the hikashop? loadFullOrder etc all works fine but am I missing something that stops the emails/notifications from being sent?
Code:

$orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;loadNotification((int)$order_id, 'order_status_notification'); $mailClass = hikashop_get('class.mail'); $mailClass-&gt;sendMail($order-&gt;mail);

Above code **works inside plugin** but **not** in my own script

Thanks for your help ![:)](/media/kunena/emoticons/3.png ":)")

\## EDIT

I have added some logging to my file and it doesn't seem to get past this block: Code:

$orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;loadNotification((int)$result-&gt;orderid, 'order_status_notification'); $mailClass = hikashop_get('class.mail'); $mailClass-&gt;sendMail($order-&gt;mail);

Is there anything I am missing to be able to use these functions in an external file? ![:)](/media/kunena/emoticons/3.png ":)")

Last edit: 8 years 5 months ago by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

8 years 5 months ago [\#293678](#293678) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293678 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

Hi,

I did a test on my end with that code: Code:

&lt;?php define('_JEXEC', 1); define('JPATH_BASE', dirname(__FILE__) ); require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; // Instantiate the application. $app = JFactory::getApplication('site'); // Initialise the application. $app-&gt;initialise(); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;loadNotification(159, 'order_status_notification'); $mailClass = hikashop_get('class.mail'); $mailClass-&gt;sendMail($order-&gt;mail);

And I got the email sent for the order 159 when calling the PHP file with that code. So it works for me.
The Joomla code comes from: [ www.simbunch.com/blog/141-instantiate-in...n-an-external-script](https://www.simbunch.com/blog/141-instantiate-initialise-joomla-2-5-3-framework-in-an-external-script)

The following user(s) said Thank You: [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")**
- [![turfymurphy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57013-turfymurphy "View turfymurphy's Profile") Topic Author
- [ Offline](/forum/user/57013-turfymurphy)

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 5 months ago [\#293679](#293679) by [turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")  Replied by *[turfymurphy](/forum/user/57013-turfymurphy "View turfymurphy's Profile")* on topic *[Sending customer email when updating order status](/forum/31-development/894881-sending-customer-email-when-updating-order-status#293679 "-- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.8 -- PHP version -- : 5.6 -- Error-message(debug-mod must be tuned on) -- : No errors  I would expect this to send an email to the customer? But no emails are being sent (they do not appear in the customer emails history). If I change it manually through the shop then it works when I tick (notify customer).  Any advice?")*

OK Great, it seems to work outside of the plugin directory, I placed the file in the main root public_html folder and it works fine.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDg4MS1zZW5kaW5nLWN1c3RvbWVyLWVtYWlsLXdoZW4tdXBkYXRpbmctb3JkZXItc3RhdHVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.082 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
