By default, magento2 promotions have the feature to create coupon code for specific customer groups. I want to send coupon code to users who already purchased products with us. Are there any settings needs to be selected in magento2 to apply for customer based promotions.?
@dinesh, If you are using Magento Enterprise edition you can use customer segments feature to send coupon codes to the customer who already has ordered with you. If you are using community edition then you can purchase magento2 extension for customer segments.
Last Option if you don't want like this then do below steps
- Create 1 field customer Id in the sales rule coupon table.
- create a script to generate coupon code on this rule and make a query of orders and fetch customer ids and generate coupon and assign that customer ids to each coupon
- create plugin afterCanProcessRule and validate customer id of current logged in user and sales rule customer id and if it doesn't match return false so the customer will not able to apply coupon code if that coupon is not specific to that customer
Please let me know if it helps you.