Shopify Flow internal emails have no order data

Solved

Shopify Flow internal emails have no order data

leon99
Tourist
6 0 1

Hi all,

I have set up a Shopify flow, but the email it's producing has no data in it? 

I'm trying to create a flow that sends an email every day with orders that are still in unfulfilled after 3 days. 

Could some please help me and explain where the flow has gone wrong? 

leon99_0-1729006308877.png

 


The email has the subject and email and that's it. 

leon99_1-1729006308863.png

 

The query I'm using in the 'get order data' step is: 

created_at:<='{{ scheduledAt }}' AND created_at:>'{{ scheduledAt | date_minus: "3 days" }}' AND financial_status:paid AND fulfillment_status:unfulfilled AND test:0 AND closed:0 AND cancelled:0

 

Thanks!

Accepted Solution (1)
RPiii
Shopify Staff
74 15 30

This is an accepted solution.

First, figure out which fields you're interested in including the email. You can find all the available fields in the API docs. Once you know that, then you can output the relevant values for each item next to each other by iterating through the list once, rather than iterating through each item multiple times for each field. For example:

{% for getFulfillmentOrderData_item in getFulfillmentOrderData %}
  {{getFulfillmentOrderData_item.orderName}}
  {{getFulfillmentOrderData_item.status}}
  {{getFulfillmentOrderData_item.updatedAt}}
{% endfor %}

You'll probably want to further modify that to include formatting (eg, as a bulleted list). Here are some other examples of using Liquid in Shopify Flow, in case that's helpful.

View solution in original post

Replies 5 (5)

Kalen_Jordan
Shopify Partner
779 36 139

I'd recommend running that query within the graphiql app (https://shopify-graphiql-app.shopifycloud.com/login) - then you can see if the query itself is working the way you expect.

RPiii
Shopify Staff
74 15 30

HI @leon99 👋 I can't really see from the workflow screenshot but are you including the desired information in the subject or body of the email within the Send internal email step? You can use Liquid to include data that's available to the workflow in the email, such as a list of order IDs and/or relevant customer contact details. 

leon99
Tourist
6 0 1

Hi @RPiii,

Thanks for your reply!

I've added in some of the variables into the message body but they don't seem to tie together well (so I've probably done it wrong) and the resulting emails don't make sense. 

I'm unfamiliar with Liquid, would I be able to write a simple query in that to provide order ID, date, fulfillment status? 

 

Thanks,

 

Leon

Screenshot 2024-10-16 103135.png

Screenshot 2024-10-16 103247.png




RPiii
Shopify Staff
74 15 30

This is an accepted solution.

First, figure out which fields you're interested in including the email. You can find all the available fields in the API docs. Once you know that, then you can output the relevant values for each item next to each other by iterating through the list once, rather than iterating through each item multiple times for each field. For example:

{% for getFulfillmentOrderData_item in getFulfillmentOrderData %}
  {{getFulfillmentOrderData_item.orderName}}
  {{getFulfillmentOrderData_item.status}}
  {{getFulfillmentOrderData_item.updatedAt}}
{% endfor %}

You'll probably want to further modify that to include formatting (eg, as a bulleted list). Here are some other examples of using Liquid in Shopify Flow, in case that's helpful.

leon99
Tourist
6 0 1

Hi @RPiii,

That's been really helpful, thank you for that. 

I can now see I was putting the query all wrong and that it needs to be one main query with the sub queries coming off it, sort of like a SQL Query with joins. 

Thanks!