How it works

Follow these 8 simple steps to send unique discount codes to new Shopify customers automatically

Shopify logo icon

Customer Created

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger captures new customer signups the moment accounts are created, enabling immediate discount delivery that capitalizes on peak engagement and conversion intent.

When a customer is created in Shopify (through account signup, first purchase checkout, admin creation, or API), this trigger activates the workflow and captures customer data including customer ID, phone number, email, and name. The workflow runs for every new customer added to your store regardless of creation method. No configuration is required—it's pre-connected to your Shopify store and automatically monitors customer creation.

Create Price Rule

App connector: Shopify • Time to complete: 3 minutes
Why this matters: Establishes the discount parameters and customer-specific restrictions that ensure each code is unique, single-use, and valid only for the intended recipient, preventing code sharing abuse.

This step creates a Shopify price rule with configurable parameters.

Configuration: You must set three key values during setup:

  1. Discount value: Default is -20 (can be percentage or fixed amount). Enter as negative number for discounts.
  2. Value type: Choose "percentage" or "fixed_amount" to define discount type.
  3. Expiration: Default is 14 days from creation. Customize the date calculation to set different expiration periods.

The price rule includes:

  1. title: Formatted as "NEWCUSTOMER [customer_id] [timestamp]" for tracking
  2. allocation_method: "across" (applies discount across cart)
  3. target_type: "line_item" (applies to products)
  4. customer_selection: "prerequisite" (only specific customers can use it)
  5. prerequisite_customer_ids: Contains the new customer's ID (makes code customer-specific)
  6. once_per_customer: "true" (single-use per customer)
  7. starts_at: Effective immediately
  8. prerequisite_subtotal_range: Minimum cart value of $1.00

The created price rule ID is returned for use in subsequent steps.

Retrieve Price Rule

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Fetches the complete price rule details after creation to ensure all parameters were set correctly before generating the discount code, preventing errors in the code creation process.

This step retrieves the full price rule record using the price rule ID from the creation step. It confirms the rule was created successfully and returns complete rule data needed for discount code generation.

Create Price Rule Discount Code

App connector: Shopify • Time to complete: 2 minutes
Why this matters: Generates the actual customer-facing discount code that combines uniqueness with memorability, making it easy for customers to use while ensuring it can't be shared or exploited.

This step creates a discount code associated with the price rule. The code follows the format "NEWCUSTOMER[customer_id]" (like NEWCUSTOMER5678901234), which makes each code unique and easily traceable to the specific customer. The code is linked to the price rule from step 2, inheriting all its restrictions and discount logic. Customers can enter this code at checkout to receive their discount.

Code format benefits:

  1. Unique per customer (prevents sharing between accounts)
  2. Easy to identify customer from code for support inquiries
  3. Trackable in Shopify analytics for attribution

Customer Add Tag

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Tags the customer profile with their unique discount code, creating an easily searchable reference for customer service and enabling segmentation of customers who received welcome offers.

This step adds the discount code as a tag to the customer record. The tag appears in Shopify admin on the customer's profile alongside other tags, making it simple for support staff to reference the customer's discount code when assisting with orders. Tags also enable filtering and segmentation—you can identify which customers have received codes, which have used them, or create email campaigns targeting tagged customers.

Tag visibility: The tag is visible in Shopify admin but doesn't appear to customers. It's purely for internal reference and marketing segmentation.

Retrieve Shop

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Fetches your store name to personalize the SMS message, making the communication feel more authentic and branded rather than generic or automated.

This step retrieves shop information from Shopify, specifically the store name which is used in the SMS message template to personalize the welcome message (like "Thank you for shopping with [Your Store Name]").

Filter (Phone Number Check)

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: Acts as a safety check that only allows SMS sending when customers provided phone numbers during signup, preventing workflow errors from attempting to send messages to empty phone fields.

This filter checks if the customer's phone field is not empty. If true (phone number exists), the workflow proceeds to send SMS. If false (no phone number), the workflow skips the SMS step and completes without error. This conditional logic ensures the workflow handles both customers with and without phone numbers gracefully.

Common scenarios:

  1. Customers who check out as guests without providing phone: Skip SMS
  2. Customers who create accounts with phone: Receive SMS
  3. Bulk imported customers without phone data: Skip SMS
sms icon

Send Message

App connector: SMS • Time to complete: 3 minutes
Why this matters: Delivers the unique discount code directly to the customer's phone with clear instructions, maximizing the likelihood they'll use it for their first purchase while the signup intent is fresh.

This step sends an SMS to the customer's phone number with the discount code.

Configuration: You can customize the SMS message template during setup. The default message includes:

  1. Thank you message with store name
  2. Discount offer (default: "Take 20% off your next order")
  3. The unique discount code

Message customization: Update the message to match your brand voice, adjust the discount description if you changed the value/type, or add additional information like expiration date or minimum purchase requirements.

SMS delivery notes:

  1. Requires SMS credits in MESA (usage-based pricing)
  2. Messages send immediately after customer creation
  3. International phone numbers supported
  4. Standard SMS character limits apply

Make it your own

Customize this workflow even further:

Send email instead of or in addition to SMS
Add an email step after the discount code creation to send a branded HTML email with the discount code, especially useful for customers who don't provide phone numbers or for markets where email is preferred.
Vary discount amounts based on customer source
Add conditional paths that check where the customer came from (using UTM parameters or referral sources) and create different discount amounts for social media signups versus organic signups.
Set minimum purchase thresholds
Modify the price rule's prerequisite_subtotal_range to require a higher minimum purchase (like $50 instead of $1) to protect margins while still incentivizing meaningful first orders.
Create urgency with shorter expiration windows
Change the ends_at date from 14 days to 48 or 72 hours to create stronger urgency and drive faster conversion while signup excitement is highest.

Frequently asked questions

What happens if a customer signs up without a phone number?
The discount code is still created and tagged to their customer profile, but no SMS is sent. The filter step prevents the workflow from failing when phone numbers are missing. Consider adding an email step as a fallback to ensure all customers receive their codes regardless of whether they provided phone numbers.
Can customers share these codes with others?
No, the price rule is restricted to the specific customer ID via prerequisite_customer_ids, so the code will only work when that exact customer uses it at checkout. If someone else tries to use the code, Shopify will reject it as invalid for that customer.
How do I change the discount from 20% to a fixed dollar amount?
In the "Create Price Rule" step, change the value field from -20 to your desired dollar amount (like -10 for $10 off), and change the value_type field from "percentage" to "fixed_amount". Don't forget to update the SMS message to reflect the new discount type and amount.
What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.

Ready to send unique discount codes to new Shopify customers automatically?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 13 min setup • Cancel anytime