New Shopify Certification now available: Liquid Storefronts for Theme Developers

Email automation triggers with a date range

Solved
AP19
Visitor
2 0 0

Hi, 

 

We want to set up an automation in Shopify Email that checks if an order has been placed in the last X (say, 7) days before sending the email. The flow should ideally be: Order fulfilled > wait 60 days > check if order placed in last X days > if not, send email

 

The issue we're facing is that we need to choose a specific date for the 'order created' variable and not a date range. Is there some way such automations can be set up? We're very new to Shopify Email and any guidance would be great. 

 

Thanks in advance!

Accepted Solution (1)
WIlliams4
Excursionist
23 3 4

This is an accepted solution.


Shopify Email does not currently offer a built-in functionality to check if an order has been placed in a specific date range. However, there are a couple of workarounds that you can use to achieve this:

  1. Use a third-party app: There are several third-party apps that you can install on your Shopify store that can help you automate email campaigns based on specific conditions. These apps typically provide more flexibility and customization options than Shopify Email's built-in automations.
  2. Use a custom workflow: If you have some coding experience, you can create a custom workflow using Shopify's Workflow API. This would allow you to create a workflow that checks the order creation date and sends the email if the order is within the specified date range.

    Here is an example of how to create a custom workflow using the Workflow API:

 

POST /admin/api/2022-10/automation/workflows.json
{
  "workflow": {
    "title": "Send email after 60 days if no orders placed in last 7 days",
    "status": "active",
    "triggers": [
      {
        "event": "order_fulfilled",
        "conditions": [
          {
            "field": "fulfillment_status",
            "operator": "eq",
            "value": "fulfilled"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "wait_time",
        "params": {
          "days": 60
        }
      },
      {
        "action": "check_orders_placed_in_last_x_days",
        "params": {
          "days": 7
        }
      },
      {
        "action": "send_email",
        "params": {
          "email_template": "order_placed_in_last_x_days"
        }
      }
    ]
  }
}​



 

This workflow will send the "order_placed_in_last_x_days" email template to the customer if no orders have been placed in the last 7 days. The check_orders_placed_in_last_x_days action would need to be implemented as a custom script that would query the Shopify API to check the order creation date.

Please note that these workarounds may require some additional effort and technical expertise. If you are not comfortable with coding or using third-party apps,  We can discuss further to fix this for you 

If this answer is good for you don't forget to marked as solution

View solution in original post

Replies 3 (3)
WIlliams4
Excursionist
23 3 4

This is an accepted solution.


Shopify Email does not currently offer a built-in functionality to check if an order has been placed in a specific date range. However, there are a couple of workarounds that you can use to achieve this:

  1. Use a third-party app: There are several third-party apps that you can install on your Shopify store that can help you automate email campaigns based on specific conditions. These apps typically provide more flexibility and customization options than Shopify Email's built-in automations.
  2. Use a custom workflow: If you have some coding experience, you can create a custom workflow using Shopify's Workflow API. This would allow you to create a workflow that checks the order creation date and sends the email if the order is within the specified date range.

    Here is an example of how to create a custom workflow using the Workflow API:

 

POST /admin/api/2022-10/automation/workflows.json
{
  "workflow": {
    "title": "Send email after 60 days if no orders placed in last 7 days",
    "status": "active",
    "triggers": [
      {
        "event": "order_fulfilled",
        "conditions": [
          {
            "field": "fulfillment_status",
            "operator": "eq",
            "value": "fulfilled"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "wait_time",
        "params": {
          "days": 60
        }
      },
      {
        "action": "check_orders_placed_in_last_x_days",
        "params": {
          "days": 7
        }
      },
      {
        "action": "send_email",
        "params": {
          "email_template": "order_placed_in_last_x_days"
        }
      }
    ]
  }
}​



 

This workflow will send the "order_placed_in_last_x_days" email template to the customer if no orders have been placed in the last 7 days. The check_orders_placed_in_last_x_days action would need to be implemented as a custom script that would query the Shopify API to check the order creation date.

Please note that these workarounds may require some additional effort and technical expertise. If you are not comfortable with coding or using third-party apps,  We can discuss further to fix this for you 

If this answer is good for you don't forget to marked as solution
AP19
Visitor
2 0 0

Thank you, this really helps. Coding doesn't seem like a viable option, so we will figure out the best 3rd party app option for our business. 

 

Thanks again!

WIlliams4
Excursionist
23 3 4

Good

If this answer is good for you don't forget to marked as solution