Autosend an e-mail to my distributor

  • Posts: 16
  • Thank you received: 0
13 years 9 months ago #6802

I'm developing a webshop where I handle the sales, including payments. After receiving the payment notification via paypal or manually update the order status in case of payment via bank transfer, my external distributor should take over by doing the order picking and shipping the order.

My distributor comes in action when he receives an e-mail with all the necessary info to ship the product. He does not want to have to access the back end of hikashop.

How do I auto-send an e-mail with the necessary info to my distributor? When I use the Payment notifications email address in configuration, hikashop only sends the following message:

Hello,
A Paypal notification was received with the status Completed. The order is now confirmed.


This notification was for the order K9 on the website www.xxxxx.com/
You can access the order details directly by clicking on the link below after logging in your back end:
www.xxxx.com/administrator/index.php?opt...task=edit&order_id=9


And as I said: my distributor doesn't want to access the back end to get the necessary info...

Thanks in advance!

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

  • Posts: 82728
  • Thank you received: 13343
  • MODERATOR
13 years 9 months ago #6803

Hi,

There is no option for that in hikashop.

However, it's not impossible. If you know PHP, you can edit the paypal plugin file ( plugins/hikashoppayment/paypal.php ) and add the necessary information to the email in the $body variable near the end of the function onPaymentNotification. You will first have to use the code below to load all the necessary information in the $dbOrder object:
$orderClass->loadAddress($dbOrder->order_shipping_address_id,$dbOrder,'shipping','name','frontcomp');
$orderClass->loadAddress($dbOrder->order_billing_address_id,$dbOrder,'billing','name','frontcomp');
$orderClass->loadProducts($dbOrder);

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

  • Posts: 16
  • Thank you received: 0
13 years 9 months ago #6811

Thanks Nicolas,

I'm not that familiar with PHP, so I will check with a friend of mine.

Regards

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

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
11 years 2 months ago #119511

Hi, my customer has the exact same scenario where they have a 3rd party distributor who takes their web orders and dispatches the goods. However, the most useful email occurs when the order is CREATED, but this no good to send to a distributor as payment has yet to be made - this is the ORDER CREATION email.

Ideally, the answer is one of two;

a) Send the exact same email as order creation, but when payment is confirmed. Or...
b) Adapt the payment notification to have the same information as the creation email

the above posts are about (B), but I can't really follow them that well. Is it possible to have some clear guidelines as to where and what to replace/add/remove to create this ? I'm not sure if there are one or two places to add the various bits of code. Option (A) would be the preference though

Thanks, nick

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

  • Posts: 82728
  • Thank you received: 13343
  • MODERATOR
11 years 2 months ago #119514

Hi,

The best is to do that:
www.hikashop.com/forum/4-how-to/23622-se...le-people.html#23627
That will send the order confirmation email (which is sent to the user when the order is confirmed and which contains all the details of the order) to the user and to the email address you add in the code.

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

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
11 years 2 months ago #119519

Thanks for the reply Nicolas, but not quite what i was after. I don't want to send multiple emails I want to either a) send the CREATION email to one or more emails, but ONLY after they've paid (i.e. confirmed status), not just at creation - but the email template is great as it has all the details etc

Alternatively, I could send a re-formatted PAYMENT email with the address details etc, but option A would be the preference.

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

  • Posts: 82728
  • Thank you received: 13343
  • MODERATOR
11 years 2 months ago #119553

I don't see why you say that it's not what you want since the order status notification email is the same as the order creation notification but the difference is that it is sent after the order is confirmed, unlike the order creation notification, and thus it seems to me that it's exactly what you're looking for.

The following user(s) said Thank You: triotech

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

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
11 years 2 months ago #119618

thanks you're right, it was basically what we wanted to do and it is working as well as it could be. My only concern was making it a BCC and not a TO and have raised this in the other post. Thanks, Nick

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

Time to create page: 0.074 seconds
Powered by Kunena Forum