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.?

1 Answer 1


@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

  1. Create 1 field customer Id in the sales rule coupon table.
  2. 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
  3. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.