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

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

Bump

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!

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.

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?

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/custom-liquid#supported-variables

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