- Posts: 217
- Thank you received: 1
Tailoring the Order creation notifications emails
13 years 5 months ago #98123
by Mat
Tailoring the Order creation notifications emails was created by Mat
hi all,
Depending on the product bought I want the Order creation notifications email address sent to different people.
How might I go about that?
Thanks,
Mat
Depending on the product bought I want the Order creation notifications email address sent to different people.
How might I go about that?
Thanks,
Mat
Please Log in or Create an account to join the conversation.
13 years 5 months ago #98201
by Xavier
Replied by Xavier on topic Tailoring the Order creation notifications emails
Hi,
You can edit the mail in question, and at the end of this mail check the products in the cart, and if product x send to y, if product a send to b, etc.
To add the addresses, you can use: $data->mail->dst_email .= ',' . 'email@toadd.com';
You can edit the mail in question, and at the end of this mail check the products in the cart, and if product x send to y, if product a send to b, etc.
To add the addresses, you can use: $data->mail->dst_email .= ',' . 'email@toadd.com';
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 10
- Thank you received: 0
13 years 4 months ago #101769
by djmelville
Replied by djmelville on topic Tailoring the Order creation notifications emails
I was searching the Forum with the very same question, and found this topic.
Xavier, I have two questions for you:
1) Could you elaborate a bit more on your response? By that I mean, could you give us a better example of what you mean by "check the products in the cart"? I am quite proficient in PHP, but without the in-depth knowledge of the internals of HikaShop, it is quite difficult to understand what you mean by the specifically.
2) Wouldn't it be much simpler (and easier) to add this functionality as an enhancement to the configuration? This could be a simple as adding a "Order Notification Email Address" column to Brand, Category, and Product, which would allow such configuration to be as granular as is necessary, and during the course of the email generation to load an array of email recipients, and then eliminate the duplicates before finally addressing the email.
Question 2 is really more of an enhancement request. What Mat and I are suggesting is really quite a common occurrence, and adding the functionality I described would make for a great enhancement to your product.
Thanks and Regards,
David
Xavier, I have two questions for you:
1) Could you elaborate a bit more on your response? By that I mean, could you give us a better example of what you mean by "check the products in the cart"? I am quite proficient in PHP, but without the in-depth knowledge of the internals of HikaShop, it is quite difficult to understand what you mean by the specifically.
2) Wouldn't it be much simpler (and easier) to add this functionality as an enhancement to the configuration? This could be a simple as adding a "Order Notification Email Address" column to Brand, Category, and Product, which would allow such configuration to be as granular as is necessary, and during the course of the email generation to load an array of email recipients, and then eliminate the duplicates before finally addressing the email.
Question 2 is really more of an enhancement request. What Mat and I are suggesting is really quite a common occurrence, and adding the functionality I described would make for a great enhancement to your product.
Thanks and Regards,
David
Please Log in or Create an account to join the conversation.
13 years 4 months ago #101782
by nicolas
Replied by nicolas on topic Tailoring the Order creation notifications emails
You can already do that with HikaMarket Multivendor.
With it, you can assign each product to a vendor and the vendor will be notified when a purchase of his products is made.
It's even better that the solution provided by Xavier because the vendor will only see his own products in the email notification. And using that feature, you don't need to edit any code.
Regarding the code, if you're already a developer, you should find quite rapidely how to loop through the products in the order for the check of who should receive a copy of the email by looking at the code already in the email.
Here is a simplified example :
With it, you can assign each product to a vendor and the vendor will be notified when a purchase of his products is made.
It's even better that the solution provided by Xavier because the vendor will only see his own products in the email notification. And using that feature, you don't need to edit any code.
Regarding the code, if you're already a developer, you should find quite rapidely how to loop through the products in the order for the check of who should receive a copy of the email by looking at the code already in the email.
Here is a simplified example :
Code:
foreach($data->cart->products as $item){ if($item->order_product_code=='my_prod'){ $data->mail->dst_email .= ',' . ' email@toadd.com'; } }
Please Log in or Create an account to join the conversation.
Time to create page: 0.204 seconds