How To Deliver a Unique Code When Someone Purchases a Product on WooCommerce

Coupon Carrier has support for generating unique time-sensitive discount codes automatically from your WooCommerce store. When a code is requested from the Code List, a randomly generated discount code is created in your store based on the settings you've provided.

Deliver a unique code when someone purchases a product

This article will show you how you can deliver unique codes to your WooCommerce customers when buying a specific product in your store. One of the more common use cases for this is to import a list of unique codes into Coupon Carrier and then to add a product to your WooCommerce store that allows someone to purchase it and then receive one of the codes in an email. It’s a way to sell unique discount codes or vouchers.

Here’s what we need to get started:

  • Coupon Carrier account (Signup for a trial here)
  • WooCommerce store
  • A list of unique codes that you want to send out when someone purchases a product

Import your unique codes

You can add your unique codes to your Coupon Carrier account by creating a new code list under the code lists tab. Add codes by pasting them or from a CSV file.

Configure the code email and trigger

Now it’s time to create a Code Email configuration. This is an email sent to a recipient, and it contains one of the unique codes. A third-party app event triggers these emails. In this case, we’ll connect to WooCommerce and choose to trigger this email when a product has been purchased. You’ll need to enter the specific product Id that you want Coupon Carrier to look for. Once this configuration is enabled, Coupon Carrier will monitor all new orders. If it contains this product Id, it will trigger the email to be sent to the email address specified in the WooCommerce order.

You can customize this email with your logo, message, etc. For even more customization, you can also upload a custom email template.

Once you’re happy with the code email content, the next step is to select the code source for this configuration. We’ll choose to use an existing code list that we created earlier, which contains the codes that we added.

The default in Coupon Carrier is only to allow one code to be sent to a recipient. For this use case, you might want to allow someone to receive multiple emails if they purchase the product more than once. If so, you’ll need to enable the option to Allow multiple codes to be delivered to the same email address.

Activate and test your configuration

We’re now ready to save the configuration and activate the configuration. Once activated, Coupon Carrier will start to monitor all new WooCommerce orders.

To test this, you can manually create a new order in your WooCommerce admin and add the product you’ve specified earlier. Once the order is finalized, you should receive an email with a code shortly after.

Still need help? Contact Us Contact Us