A space to discuss online store customization, theme development, and Liquid templating.
Hi everyone,
I've been trying to work out how to set up an automation that will send a follow-up email when purchasers buy from a specific collection. Apparently, the default automations module in Shopify only allows you to do these automations with the "Order" and "Shop" endpoints:
but I was wondering if there's the possibility to use the Collection" endpoint https://shopify.dev/docs/api/admin-graphql/2023-07/objects/Collection
I understand that this is something that is set this way by default in Shopify and I don't know if there is a possibility to request to change this so that they enable more endpoints into this module.
If you guys know of any other way by which to achieve this, please let me know how.
Hi ManuelKopi,
While Shopify's default automation module might not directly support Collection-based triggers, there are still ways to accomplish what you need by leveraging other tools and Shopify's API.
One approach to consider is using Shopify webhooks. Shopify webhooks allow you to listen to specific events (like an order being created) and then perform an action in response (like sending an email). Here's a high-level overview of how this might work:
Set up a Shopify webhook for the orders/create
event. This will trigger every time an order is created in your store.
When your webhook receives an order, check the line items of the order to see which products were purchased.
Use the Shopify API to fetch information about the collections those products belong to. You can use the collections
endpoint you mentioned, or you might find it simpler to use the products
endpoint and look at the collection_ids
field of each product.
If a product belongs to the specific collection you're interested in, send a follow-up email using your preferred method (e.g., an email service provider, or a server-side script if you're comfortable with coding).
Alternatively, you could look into using a third-party app like Klaviyo or Mailchimp, which offer more advanced email automation features. These apps allow you to segment your customers based on what they've purchased, and could potentially let you target customers who have bought from a specific collection.
I 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