I want to create a page after order complete with woocommerce which shows some ads or coupons when click on user click on any ads or coupon(button), email will receive to user with coupon code and admin will receive email with user data. How to implement this functionality?
Asked
Active
Viewed 300 times
1 Answers
0
If you need to send custom mail you can use wp_mail() wordpress function for that.
- You can use hook after order is completed ('woocommerce_thankyou' example)
- Use wp_mail() function and send mail with data. You can check it here: https://developer.wordpress.org/reference/functions/wp_mail/
If you need to do this when someone click on banner or ad on page, then you need ajax call.
I think this help

Arsic Aleksandar
- 1
- 1
-
-
All about WP and ajax can check here: just follow steps. [link](https://wpmudev.com/blog/using-ajax-with-wordpress/). For Your situation, you must make ajax call when someone click on your ad/banner. If You still need help notice me. – Arsic Aleksandar Jul 27 '22 at 13:14