Reward customer who write review

Many merchants asked me to add reward functionality to my Reviews module. This task is on the roadmap, but only for paid version. If you are using my free version, or if you are unwilling to wait, you can use conseqs module to do this yourself now.

Note: before you start make sure you have latest version of revws module installed. Integration with conseqs was added in version 1.1.0 (free), respective 2.1.0 (premium)

Assignment

After review has been approved by administrator, generate discount coupon and send it to customer. This does not applies for guest reviews.

Battle plan

Because there are two actions we want to perform (generate coupon and send it to customer), we will need to create two conseqs rules. First rule will generate the coupon, second rule will send it to customer. Let's start

Generate voucher

We will start by creating new Rule to generate voucher. To do this, go to your Rule overview, and click on New Rule. Go to Rules overview page and click on CREATE RULE button. 

create new rule

If you have latest version of revws module installed, you will find that there are Revws-specific triggers. Let's choose the one named Revws: Review approved - this one is executed when review is approved by administrator.

 

Because we don't want to generate vouchers for guest reviews, we will need to create a condition. Go to conditions step, and click on Add Condition. We will use Review: ID customer field to filter out reviews that are not created by customers. If review is created by customer, this field will have nonzero value. If it's created by guest, this field is zero.

So let's create condition: Review: ID Customer > 0

Now go to action section and choose Create Voucher action. This action comes in two flavours. You can either create voucher for specific amount, or as a percentage. Choose the one that's appropriate for you.

I will choose Specific amount version. 

Now we need to provide parameters for this action:

  • Customer ID - we will use id of customer that created review.  That means we need to bind this parameter to Review: ID Customer field
  • Voucher name - we can be fancy and use interpolate values method to create nice looking name for voucher. For example: "Thank you for creating review {title}", where title will be substitute for review title
  • Code prefix - prefix of voucher. This will be important later. Let's assign this to constant value REV
  • Validity - enter number of days this voucher will be active 
  • Currency - enter discount currency
  • Amount - enter discount amount
  • Tax included - decide if amount is with or without tax

The result looks like this:

All right. Now save the rule and first step is done. Now, when you approve review, new discount voucher will be generated for the customer.

Send notification email

First of all, we need to decide what email template to use. We can use standard template voucher_new. If this does not work for you, you can go to your theme mails directory, and copy voucher_new.html and voucher_new.txt files under new names. For example, save them as review_voucher.html and review_voucher.txt. You can then edit them to meet your needs. Conseqs will detect that this new template exists, and will let you use it.

Now we need to decide which trigger to use. We could use the same trigger as in the previous step, but then we wouldn't know code of generated voucher. So the email would have to contain only some generic text like 'You have new voucher, you can find more on discount overview page'.

But we want email to contain voucher information, especially its code, so we will use different trigger. Let's choose After record has been created, and select Cart Rule record type. This trigger will execute every time new voucher is created

Because we want to send emails only for vouchers created by our previous rule, we need to create some conditions to achieve that.

Remember how we used REV as a code prefix for our vouchers? We can use this information to detect review vouchers! So let's create condition: Code prefix contains REV:

OK, so now this rule will execute action when new voucher is generated and its code contains prefix REV. All that's left is to actually send an email. Go to Actions step, and choose action Send email. Select email template you want to use, and bind all template parameters. For example like this:

As you can see, I've bound customer-related parameters like {firstname} or email address to customer associated with cart rule. I've provided custom email subject

Thanks {firstname} for creating a review, here's your reward

Where {firstname} will be substituted for customer first name.

Conclusion

And that's all. We now have two rules. First rule will create new voucher when customer leaves review. This will, in turn, trigger the second rule and email will be sent to your customer.


Related products