How to search for all orders without a customer email?

joshdane
Shopify Partner
33 0 22

We sometimes have people reach out to us asking why they haven't received an order confirmation email. We then find that they ordered with their mobile number instead of their email. 

We want to find and tag all these customers that don't have an email attached to their account so we can glance at the tags and help them find the text etc. 

How can I search for all orders with no email attached? 

I found this Shopify help article - https://help.shopify.com/en/manual/orders/search-view-print-orders#filter-orders-using-custom-terms which mentions you can use structure search terms and links here -> https://shopify.dev/api/usage/search-syntax?shpxid=17fd605d-4C6F-48F3-B8C0-DF9237AFA045#search-query...

However, I can't get a structures search term to work. 

For example I have an order from a customer, let's call her Diana. 

Entering this search term: first_name:Diana

first_name:Diana

doesn't return any results. 
Neither does

first_name:"Diana"

 

However entering just

Diana

does work. 

Surprisingly 

NOT Diana

also works and displays all the orders made by customers not named Diana. 


Any idea what I am doing wrong?

 

Replies 4 (4)

joshdane
Shopify Partner
33 0 22

Found a potential solution. 

Went to the customers page and tried using search operators and found they worked. 

Searching for 

email:customeremail@gmail.com

worked. 

 

Searching for

NOT email:customeremail@gmail.com

also worked and showed me all customers without that email. 

 

Then I tried the * operator and it showed me a subset of all my customers, the ones that had some email. 

email:*

I felt a glimmer of hope rising. 

 

I then tried 

NOT email:*

and behold, it worked and showed me customers that didn't have an email. 

 

Now I just need to figure out how to get all the orders from this subset of customers. 

 

joshdane
Shopify Partner
33 0 22

Hmm the journey continues. 

I can tag all customers if they don't have an email. But I can see no way to tag or find orders, based on customer data. 

How can I tag orders based on customer information? 

joshdane
Shopify Partner
33 0 22

Looked in the API docs and found that orders does have an email attribute. I thought I would have to access the email via the customer object. Something like customer.email=XYZ.

But nope, the Order object has an email field. 

However, still can't get a structured query to work on the Orders page. 

erer56
Visitor
1 0 0

I never tried to do it so don't have a clear idea about it buy I know about some sources that can help you to solve this issue just see here one of them.