I am getting an email when a customer orders an item, fine. However, when they use a coupon code, I only get the discount amount in the email and I do not see the coupon code used. I need to see the coupon code as well. Is this something you can help with? I shall be grateful .
Hey Ravin,
This forum is specifically for questions about Corvid by Wix.
Have you set this up by adding code to your site or are you just using the Wix Stores app?
If you have added code to your site please provide a snippet of the code you are having an issue with and a screenshot of the email you received.
If you have not added any code to your site please contact Wix Support .
Thank you!
Dara | Corvid Team
Hi Dara,
Thank you for the response. I have not added any code. I am just expecting basic information from the order, that is the coupon code used with the order. I have already spoken to Wix support and they promised me revert within 48 hours. I contacted them about 24 hour ago so I am sure in next 24 hours I will be responded to. If you can help on the issue, I shall be thankful.
Regards,
Ravin
Hi Dara, I am not able to upload the email as an attachment so adding an image. The image is a snippet from the email I (as a seller) received as soon as an order was placed by the customer. Please see the comments in the red box below. Can I get some help?
Hi Ravin,
As I said, this forum is specifically for questions about Corvid.
If you are not adding code to your site we are unable to assist you here.
As far as I know it is not possible to edit that confirmation email from Wix Stores but you could create your own notifications by adding code to your site.
You could use the notify() function to send yourself notifications and you decide what information is provided in those notifications. You could add the onNewOrder() function to the backend and run the notify() function upon a new order creation.
Hope this helps!
Dara | Corvid Team
Dear Dara,
Thank you for explaining the process. I am ready to write the Corvid code and that is where I need help.
As you correctly mentioned, I can use the onNewOrder() function to access the order, however my issue is that the order object has all information about the order, except for the Coupon Code . I have pasted the snippet from https://www.wix. com/corvid/reference/wix-stores-backend/events/onneworder page for your quick reference. See line number 28 (in Orange) in the code below that has the Discount applied, but not the Coupon used.
I would like to see or access something like what I have shown on line number “28.5” in Blue, which is currently missing from the Sale Event Object.
Is there a way I can get the Coupon code?
I thank you again for spending time with me here on this topic.
// Place this code in the events.js file
2 // of your site’s Backend section.
3
4 export function wixStores_onNewOrder ( event ) {
5 let newOrderId = event . orderId ;
6 let totalPrice = event . totals . total ;
7 }
8
9 /* Full event object:
10 {
11 “orderId”: “2cd413bd-ddea-4101-b122-e8b146fec05f”,
12 “number”: “10005”,
13 “dateCreated”: “2018-08-05T12:33:18.938Z”,
14 “buyerInfo”: {
15 “id”: “6g004532-732d-829f-5kf9-f9rk42afpla04m”,
16 “identityType”: “MEMBER”,
17 “email”: “john.doe@somedomain .com”,
18 “firstName”: “John”,
19 “lastName”: “Doe”,
20 “phone”: “5555555555”
21 },
22 “currency”: “USD”,
23 “weightUnit”: “LB”,
24 “totals”: {
25 “subtotal”: 99.99,
26 “shipping”: 4.99,
27 “tax”: 8.87,
28 “discount”: 9.99,
28.5 “couponcode”:“HNY2021”, //note this is missing currently
29 “total”: 103.86,
30 “weight”: 1.37,
31 “quantity”: 2
32 },
33 “paymentStatus”: “PAID”,
34 “fulfillmentStatus”: “FULFILLED”
35 }
36 */
Hey Ravin,
I did some looking into this and if you use the onCartCompleted() function instead of onNewOrder() you can get the details of the coupon code that was used.
Hope this helps!
Dara | Corvid Team
Hey Dara,
I think we are getting close. However, I understand from the documentation that I must use external email providers to send this email to admin. Is it true or I can use Wix internal email server to send this email?
The issue is that external email service providers ask a lot of questions about how I am acquiring client data. However, I am not sending this email to clients in the first place.
I am already getting email from my website when an order is completed and would like to receive email in the same manner - just with the different content.
Would you be able to enlighten me with a little work descriptive guidelines?
God bless you.
R.
I am in need of getting the coupon code in the order email also. How was this finally resolved?