Introduction
Voucherify is an all-in-one promotional platform that allows for personalized campaigns and loyalty programs that drive user engagement and retention.
MoEngage <> Voucherify
The MoEngage and Voucherify integration allows you to grow your promotional campaigns by sending unique codes through the use of Content APIs. With this integration, you can inform your customers of promotions and distribute personalized coupons to every one of them. Thanks to event-triggered MoEngage campaigns, you can react to certain occasions with new Voucherify coupons and gift cards being delivered to your customers.
The below example implements the following scenario:
- Customers who haven’t visited the store should be offered a discount coupon to draw them back.
- Only the customer who has been gifted with the voucher should be able to redeem it.
- The customer should receive personalized coupons via email.
Integration
library_add_check |
Prerequisites
|
Step 1: Prepare a Voucherify campaign to engage inactive customers
- On your Voucherify dashboard, create a new Unique Coupons Campaign.
- Get your Campaign ID by calling the get campaign endpoint or in your browser address bar when you open the campaign dashboard:
Step 2: Configure a MoEngage ContentAPI endpoint which will publish new code from the above campaign
On your MoEngage account, navigate to Settings → App → APIs → Content API tab and click the ‘Add’ button.
- API Name: this is the name of the Content API endpoints. It cannot be changed afterward. In this case, it is named
new_reactivation_voucher
because it will send out voucher codes from theCustomer Reactivation
campaign. - API Url: type in the address of the Create Publications endpoint:
{{API_URL}}/v1/publications/create
. You can find your API Url in your Voucherify Project Settings in theApplication Information
section. - In the Parameters tab:
- Add a campaign parameter and fill in your Voucherify campaign ID.
- Add a customer parameter and fill in the MoEngage field that should be used as the customer’s source_id field in Voucherify. In this case, the customer’s email is used as source_id. You can learn more about MoEngage users’ attributes here.
- In the Headers tab:
- Add
X-App-Id
andX-App-Token
headers. You can generate the application keys for integration with MoEngage in your Voucherify Project Settings, in theIntegration Keys
section. -
Set
Content-Type
header toapplication/json
.
- Add
- After you save the configuration, you can test it with a play icon. If everything was configured correctly, you will see Voucherify’s response.
Step 3: Use the Content API endpoint in a MoEngage campaign
- Create a new MoEngage campaign.
- Prepare the email content. Using the templating language Jinja you can insert e.g. customer name into the content and call the Content API endpoint created in step 2, parse its response, and display the desired information to the customer. You can find out more about using Jinja in MoEngage in this article.
- To call Voucherify’s create publication endpoint and publish a new code to an email’s recipient use this code snippet:
{% set publication = ContentApi.new_reactivation_voucher({({"params":{"customer":"{{UserAttribute['Email (Standard)']}}"}})}) %}
- To extract only the published voucher’s code from the response, use this expression
{{publication.voucher.code}}
- To call Voucherify’s create publication endpoint and publish a new code to an email’s recipient use this code snippet:
- You can preview how the message will look to a particular customer after you click the preview button in the template editor, in the personalised mode or you can test it by sending an email using the Test Campaign field below the template editor.
- When you publish your campaign and messages will be sent (on a scheduled time or as soon as possible), each message will be tailored for every customer and will contain a voucher code that has been published to them:
- You can also observe each publication call made during the email send-out in the Audit Log in your Voucherify Dashboard:
And see generated codes on your Voucherify campaign dashboard:
Referral code and loyalty card publication
The process of assigning a referral code or loyalty card is very similar to the one described above. All you need to do is to change the campaign name parameter to the referral or loyalty campaign that you have created. Here you can learn more about Voucherify referral programs and loyalty programs.
In this example, we’ll retrieve the customer’s code from the referral program with the id: camp_f0bKCWIYyTfOept56g2UMLY7
. Thanks to the ‘Customer will be allowed to join campaign only once’ option turned on in the referral program configuration if the customer is already a program member, then their card code will be returned and if they have not yet got a referral code assigned, they will and new code will be present in the response.
- Configure the Content API endpoint:
- To invoke the function to retrieve the loyalty card use the following code:
{% set ref_code = ContentApi.get_customer_referral_code({({"params":{"customer":"{{UserAttribute['Email (Standard)']}}"}})}) %}
The customer’s referral or loyalty card code will be accessible using the same snippet:{{ref_code.voucher.code}}
. The customer can share their referral code with a friend. When they use it during making a purchase, the referrer will be awarded the gift you’ve set up in the Voucherify Dashboard.