How to give out campaign codes in a HubSpot workflow
A campaign can give its codes to your HubSpot contacts from a workflow. The workflow asks Coupon Carrier for a code, Coupon Carrier saves it in a contact property, and your own HubSpot email shows it.
Your workflow needs three steps:
- Any trigger enrolls the contact.
- The Coupon Carrier action gets the code and saves it on the contact.
- Send email shows the code with a personalization token.
The Coupon Carrier action waits until the code is saved, so you don't need a delay before the email.
Before you start
- You need a campaign with at least one offer that has codes.
- This works in contact-based workflows only.
- A campaign uses one email tool. All its offers go through the HubSpot account you choose in step 1, and your workflow must be in that same HubSpot account.
Step 1: Choose your HubSpot account in the campaign
- Open your campaign in Coupon Carrier.
- Open Email tool. If the campaign doesn't use it yet, you find it under Other ways to give out vouchers. Click Set up.
- Under Your email tool account, click Use this account next to your HubSpot account. If HubSpot isn't connected yet, click the HubSpot button in the same section to connect it, and sign in.
Step 2: Create the contact property for the code
Coupon Carrier saves each code in a contact property. The Contact property for the code field suggests cc_code . Until that property exists in HubSpot, you see the notice Create cc_code in HubSpot.
- In HubSpot, open your property settings and create a new contact property.
- Choose single-line text as the field type.
- Set the internal name to
cc_code. The label can be anything, for example "Coupon code". - Save the property.
Back in Coupon Carrier, reload the campaign page. Under the field you now see a check mark and "cc_code is in your HubSpot account."
Do you already have a property for codes? Enter its internal name in Contact property for the code instead. Use the internal name, not the label. It has only lowercase letters, digits or underscores.
Step 3: Copy the offer's ID
- In the Email tool section, find Coupon Carrier action. It lists your offers.
- Click Copy ID next to the offer your workflow should give. The ID looks like
Qm7Lx2-3.

Each offer has its own ID, and one Coupon Carrier action gives one offer. To give another offer, add another action with that offer's ID, in the same workflow or in another one.
Step 4: Add the Coupon Carrier action to your workflow
- In HubSpot, create a contact-based workflow or open one you have. Use any trigger you like.
- Add an action. In the Coupon Carrier section, choose Trigger Unique Code or QR/Barcode.
- Paste the offer's ID into Configuration ID and save the action.

This is the same action you may already use with a Code Email configuration. Only the ID is different.
Step 5: Add your email
- In HubSpot, create the email and save it for automation. Where the code should show, add the personalization token for your property:
{{ contact.cc_code }} - In the workflow, add a Send email action right after the Coupon Carrier action, and choose your email under Automated email. The workflow moves on when the code is saved, so no delay is needed.
- Turn on the workflow.

Step 6: Test it
Until you go live, your campaign is in test mode. In test mode, contacts get a TEST- code and no real codes are used.
- Enroll yourself in the workflow.
- Open your contact record in HubSpot. The
cc_codeproperty shows a code that starts with TEST-, and the workflow moves on to the email.
When everything looks right, click Go live in Coupon Carrier. From then on, contacts get real codes.
Good to know when you test: one person gets one voucher per offer. If the same contact reaches the action again, they get the same code again, unless the offer gives a new code after a number of days. Coupon Carrier also counts mia+test1@example.com and mia+test2@example.com as the same person as mia@example.com , and ignores dots in Gmail addresses. To see different codes, test with addresses that are really different.
When no code can be given
Sometimes Coupon Carrier can't give a code. The action then ends with a skipped reason, and the workflow continues anyway. The contact moves on to the next step, so your email is still sent.
Coupon Carrier doesn't clear the property when this happens. A contact who has never had a code gets an email with an empty token. A contact who already has a value in cc_code sees that old value. It can be a code from another offer, an earlier code for the same offer, or a TEST- code from your testing.
If that matters for your campaign, do one of these:
- Add a step before the Coupon Carrier action that clears
cc_code. Then add a branch after the action, and send the email only whencc_codehas a value. Clearing is safe: a contact who already has a code for the offer gets the same code saved again. - Branch on the outcome of the Coupon Carrier action, and send the email only when it succeeded.
These are the skipped reasons you can get, and what to do:
- Sold out: the offer has no codes left. Add more codes to the offer.
- Campaign paused: the campaign has been live and is now paused. Start it again.
- No longer available: the offer was removed or turned off, or its codes have passed their end date.
- The email tool channel is off: the email tool is turned off in the campaign. Open Email tool and click Turn on the email tool.
- The ID isn't a campaign offer's: the ID in Configuration ID is wrong, or the campaign or offer has been deleted. Copy the ID again with Copy ID.
- Copy an offer's ID from the campaign: Configuration ID has the campaign's own ID. Use an offer's ID from Copy ID instead.
- HubSpot isn't the campaign's email tool: the campaign uses another email tool, or no HubSpot account is chosen. Go back to step 1.
- The campaign is connected to another HubSpot account: the workflow is in a different HubSpot account than the one chosen in the campaign.
- Reconnect HubSpot: reconnect your HubSpot account in Coupon Carrier.
- No email address found on contact: the contact has no email address, or it isn't a valid one.
- The test limit for today is reached. Try again tomorrow.: a campaign in test mode gives a limited number of test codes per day.
- Could not update contact in HubSpot: the code couldn't be saved on the contact, for example because the property doesn't exist. Coupon Carrier first tries again for about half an hour, and the contact waits in the action during that time. Check that the property in Contact property for the code exists in HubSpot.