Send e-mail to ADMIN after order is confirmed

  • Posts: 585
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
9 years 4 months ago #206738

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4
-- Browser(s) name and version -- : All

Hi,

The ADMIN receives an e-mail after an order is created.
But the ADMIN (also) likes to have an e-mail after an order is confirmed.

This question is related to this issue: www.hikashop.com/forum/orders-management...of-order.html#206736
Because if you don't get an cancelling e-mail, the ADMIN don't know if the order is paid and you can't start picking the products. In this situation the ADMIN don't want to use the backend from Hikashop to check if an order is paid.. He just want to rely on the e-mails which are sent by HikaShop.

Is this possible?

Hope to hear from you.

Kind regards,
Lumiga


Kind regards,
Lumiga

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

  • Posts: 2143
  • Thank you received: 747
9 years 4 months ago #206752

Hi,

There are only two possible triggers changing the order status from "created" to "confirmed":
Either it's the Admin doing so manually (which wouldn't require him to be notified per email).
Or the order status is changed to "confirmed" once the payment is made.

So, the trigger is in the payment method. Means that if you want the Admin to receive an email message as well once the order is "confirmed" (= payment has been made), depending on what payment method(s) you use, you must look into their backend configuration and enter the Admin email as CC, BCC, or whatever field there is for it - again, depending on payment method.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 585
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
9 years 4 months ago #206780

Hi,

Oké we are close now! ;-)
But I think we are talking about different e-mails.

The payment method (cciDEAL) we use, does send an e-mail after a payment has been mate.
But this is not the e-mail where I'm talking about. Because now the Admin (Shop holder) has to compare for which order the payment has been made.

The e-mail we need for the Admin (shop holder) is the same as the e-mail he receives after an order is created (with a list of the order with all the products details in it). But now also after the order is confirmed so that he don't have to compare with other e-mails and directly can start picking products.

For the client there is an equal value solution because they get an e-mail after an order is created and also after an order is paid.
These e-mails look the same but the only different is the opening paragraph (created / status changed to confirmed).

Hopefully you know what i mean :)


Kind regards,
Lumiga

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
9 years 4 months ago #206790

Hi,

HikaShop doesn't send any email to the admin when the order is confirmed (besides the payment notification email sent by the payment plugin). It however sends an email to the customer. So an easy solution is to edit the order status notification email via the menu System>Emails and add your email address in the BCC field there and you'll get a copy of that email with all the information.

The following user(s) said Thank You: Lumiga

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

  • Posts: 585
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
9 years 4 months ago #207046

Thanks that is an good alternative. But maby it's a good request for future releases.

See my image how it could look like in future release:

Thanks!


Kind regards,
Lumiga
Attachments:

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
9 years 4 months ago #207051

Our goal is instead to replace the payment notification email with an email with all the information about the order in it.

The following user(s) said Thank You: Lumiga

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

  • Posts: 585
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
9 years 4 months ago #207194

Oké Cool


Kind regards,
Lumiga

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

  • Posts: 152
  • Thank you received: 1
9 years 3 months ago #211342

Hi Guys,

Ok so on this subject - would it be possible to add some custom code to the email "Order Status Notification" that says: if status = confirmed - then please cc email to xyz@xyz else = do nothing.

And if so, could you help me with that code snippet? :)


Believe in Better

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
9 years 3 months ago #211344

Sure. You can add such code in the HTML version of the email:

<?php if($data->order_status=="confirmed"){ $mail->bcc_email = 'xyz@xyz'; } ?>

The following user(s) said Thank You: nowherenowhere

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

  • Posts: 152
  • Thank you received: 1
9 years 3 months ago #211444

Hiya Nic,

Thank you! As always you are great at what you do. But I seem to have a problem with the email not being fired off. I've applied this snippet to "Order Status Notification" email in the HTML view.

I've placed it:

<?php
/**
* @package HikaShop for Joomla!
* @version 2.5.0
* @author hikashop.com
* @copyright (C) 2010-2015 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php if($data->order_status=="confirmed"){ $mail->bcc_email = 'info@xyz'; } ?>

and tried a few tests where I change the order status in the backend // customer orders - to Confirmed.. But no email is being recieved - am I doing something wrong?


Believe in Better

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #211450

Hi,

How exactly do you change the order status in the HikaShop backend ?
In the order listing ? In the order edition ?

By using HikaMarket ; you can use it to notify some users when the order is modified to some specific order statuses.
Even if it has been think for the multi-vendor ; it is also working for the main vendor.
So if you set the HikaMarket ACL "order / notify" and set some filters for the setting, the targeting users will receive the order notification email.
www.hikashop.com/support/documentation/1...ml#config_main_email

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: nowherenowhere

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

  • Posts: 152
  • Thank you received: 1
9 years 3 months ago #211479

Hi Jerome,

Yes in this case I am testing, so not using the paypal IPN to change the status... So it goes to paypal, but then I cancel the order. Now in order listing the order status = cancelled - (Hika Business/ not market) then I change the order status to confirmed instead of cancelled/ created) I set [] notify customer to yes and save - status now = confirmed... and order status to customer = confirmed (email is recieved) but... the BCC code snippet I added above - that is not sending the BCC of that email notification to the nominated email address.. Thats my problem :)


Believe in Better

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #211523

Hi,

Okay ; that's the issue.
When you're in the order listing ; when you check the box for the notification, as you can see the email is visible and you can edit it.
It means that your setting for the BCC is not used, for two reasons.
1 - It is not using the email you modified
2 - Even if it was the right email, you are sending the mail manually and not using the order notification system.

That's why you must modified the order status directly when editing the order.
In that case it should work better.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 9 years 3 months ago by Jerome.

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

  • Posts: 152
  • Thank you received: 1
9 years 2 months ago #213776

Hi,

If I have a Confirmed By Shopper status, will it look like:

<?php if($data->order_status=="confirmed_by_shopper"){ $mail->bcc_email = 'xyz@xyz'; } ?>

or something else?


Believe in Better

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
9 years 2 months ago #213777

Hi,

Yes, you can do it like that. This means that your order status is called "confirmed_by_shopper" and not "Confirmed By Shopper"

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

  • Posts: 152
  • Thank you received: 1
9 years 2 months ago #213866

Hi Nicolas,

Does that mean if my order status = "confirmed by shopper" in order status listing. Then it must reflect like so:

<?php if($data->order_status=="confirmed by shopper"){ $mail->bcc_email = 'xyz@xyz'; } ?>

---

But I think I still have a problem here, you see the order status is being changed by the payment gateway to confirmed by shopper. Then the site admin review the order and when they are happy then change the status in orders listing on the backend to -"Confirmed"

At this stage its easy to click the "Notify Customer" box - but is there a way I can also set it so that it will automatically email this now "confirmed" order to email BCC to a specific email address? Could I perhaps hardcode this into a view or something? - Where do you recommend?

Thank you as always Nic


Believe in Better
Last edit: 9 years 2 months ago by nowherenowhere.

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
9 years 2 months ago #213890

Hi,

On the listing you get a translated version of the order status if you translated it. It's only when you edit the order status that you see the real value that you need to use in your if condition.

I didn't understand your second question ? If you want to have a BCC email address in your email, edit your email and add the email address in the BCC field of the email. There is no need to code anything. But maybe you're talking about something else ?

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

  • Posts: 18
  • Thank you received: 0
8 years 9 months ago #227731

Have a similar question. I have the plugin attachinvoice (Attach Invoice to the order confirmation e-mail) installed.
How can I edit order_admin_notification to:
- send an email with only 1 line as message
- all the order details in 2 PDF-attachments: (1) order confirmation for the office and (2) pick list for the store employees.

I have tried to fiddle in the email with CSS page-break-before:always and the like, but Chrome is stubborn in removing that from the mail. So I cannot print 2 pages from the mail. Besides, the client wants 2 separate documents.

Can you please give me a hint to accomplish this?

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

  • Posts: 13201
  • Thank you received: 2322
8 years 9 months ago #227761

Hi,

For the email part, you can edit the email directly via the menu HikaShop > System > Emails, and remove all the undesired blocks.

Regarding the PDF part, by default the plugin is attaching the invoice. By editing it you can potentially have on of the two documents but, to have the second document I think that you will have to edit the plugin in order to rename its files and its classes / names (so open the attachinvoice.php and attachinvoice.xml files). Once everything renamed, install this version of the plugin in order to have two times a plugin with the same features.

And finally edit the invoice file in the attachinvoice folder to have the desired content for the second document.

Hope this will help you.

ps: it require php knowledges.

The following user(s) said Thank You: schipperskwartier

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

  • Posts: 18
  • Thank you received: 0
8 years 9 months ago #227808

Ok merci Xavier.

Xavier wrote: it require php knowledges.

No problem here :)

Xavier wrote: [...] edit the email directly via the menu HikaShop > System > Emails [...]

No problem either. I will try to do this modification in 2 steps:
step 1. Make 1 PDF document, with 2 pages (invoice data and pick list in one PDF)
step 2. Edit and rename classes, as you suggested, in order to get 2 documents (invoice data and pick list as separate PDF's). But that's more work :)

Xavier wrote: [...] edit the invoice file in the attachinvoice folder to have the desired content [...]

So if I'm correct, editing the file /plugins/hikashop/attachinvoice/attachinvoice/invoice.php will have consequences for every order status? Or just the order_admin_notification?
In other words: if I edit [...]/invoice.php (with the pick list), will every invoice-PDF contain the pick list?

If so, then I have 2 choices:
- implement step 2 and forget about step 1 or
- attach the PDF only in order_admin_notification and convince my client in having only 1 document :)

What do you think?
Thanks for your advise.

Last edit: 8 years 9 months ago by schipperskwartier.

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

Time to create page: 0.128 seconds
Powered by Kunena Forum