Flow Automation: Triggering Workflows When a New Discount Code Is Added
You can use the New discount code trigger in Flow Automation to automatically start a workflow whenever a new discount code is added to a discount code campaign. For example, when you add exclusive discount codes for an influencer or channel partnership, you can automatically notify your marketing team to distribute the codes or track how many codes have been added to the campaign, reducing manual follow-up.
This guide explains the actions supported by this trigger, how to test the workflow, and a practical example of how to use it.
Supported Actions
The following actions are commonly used in workflows initiated by the New discount code trigger:
- [General] Send email
- [Order] Batch query orders
- [General] Update counter
- [General] For each loop (iterate)
| Note: In workflows initiated by this trigger, you can click + Add variable to reference the new [Discount code] and the [Discount rule ID] of the campaign it belongs to. |
Testing the Workflow
To test whether the workflow is triggered when a new discount code is added, follow these steps:
- In Flow Automation, create a workflow using the New discount code trigger and the Send email action, then click Publish.
- In the SHOPLINE Admin, go to Discounts and select a discount code campaign to use for testing.
-
In the campaign's basic settings, click View all to open the discount code list.
-
At the top of the discount code list page, click Bulk generate discount codes, set Discount code quantity to 1, then click Generate.
Note: For more information on adding discount codes to an existing campaign, refer to the "Adding Additional Codes to an Existing Campaign" section in the "Setting Up Bulk Discount Codes for a Discount Code Campaign" guide. -
After the discount code is generated, return to Flow Automation to check the workflow's execution results.
Note: For more information on monitoring workflow execution, refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. - Confirm that the workflow was triggered and the Send email action was completed successfully.
Example Use Case
The following example shows how to use the New discount code trigger to automatically notify your marketing team when a new discount code is added, so they can distribute it to the appropriate partner.
Scenario: You're running an influencer partnership campaign and need to add exclusive discount codes for your partners. Whenever a new code is added, the workflow automatically sends an email to your marketing team, allowing them to promptly share the code with the corresponding partner.
Configure the workflow as follows:
- Trigger: New discount code
-
Action: Send email
- Subject: New Discount Code Added: [Discount code]
- Content: A new discount code, [Discount code], has been added to the discount campaign (Rule ID: [Discount rule ID]). Please share this code with the appropriate partner promptly.
- Recipient: Your marketing team's email address
| Note: To insert the information shown in square brackets (such as [Discount code] and [Discount rule ID]), click + Add variable and select the corresponding parameters. |
Outcome: Your marketing team receives an email notification whenever a new discount code is added, allowing them to promptly share it with the appropriate partner and avoid delays in promotional activities.