Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How can I pull the most recent product the person ordered in an email?

How can I pull the most recent product the person ordered in an email?

ShelHealth
Excursionist
28 0 8

I'm trying to set up a custom liquid in an email template to send the customer a reminder to re-purchased the product that they previously ordered.

 

I've tried using customer.orders, but it comes up blank. In fact, even customer.name/customer.email comes up blank. How can I access the previous order information of the email recipient?

 

Alternatively, if there is no way to do this via Liquid, is there an e-mail API? I tried finding it but the closest thing I found was MarketingEvent but I don't think I can schedule emails through that.

 

Thanks

Replies 5 (5)

ShelHealth
Excursionist
28 0 8

Liam
Community Manager
3108 344 911

Hi ShelHealth,

 

Which specific email notification are you looking to customise? As you noted it may not be possible to access previous order data via Liquid - it could be worth seeing if the Orderly Emails app might achieve the effect you're looking for here. 

 

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ShelHealth
Excursionist
28 0 8

I'm trying to create a flow with a new email notification to re-purchase the same product that the person last purchased. I need to pull which product they purchased and send it in an email.

 

The app you suggested seems to just offer different templates for already existing email options.

Liam
Community Manager
3108 344 911

Okay - if it's a net new email then you'd want to explore other options. How are you currently sending this reminder (eg via the Shopify Email app)? There's no method to automate sending emails to previous customers, so if you wanted to leverage our API, you'd need to create a email service that pulls order and customer data via the API. Have you looked at other app solutions such as Omnisend or Automizely Email Marketing

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

gerardm
Shopify Partner
10 0 4

From what I can tell you can only use the variables listed here:

 

https://help.shopify.com/en/manual/promoting-marketing/create-marketing/shopify-email/create-email/c...

 

So something like {{ data.customer.first_name }} -- You will not be able to gather order data. You may want to checkout notification Webhooks:

 

https://help.shopify.com/en/manual/orders/notifications/webhooks

Web Developer | Shopify Expert
thinknerve.com
Need more in-depth help - email me
Did I help you out - buy me a coffee