Event
Last updated
Was this helpful?
Was this helpful?
{% assign data = hash %}
{% assign data["foo"] = "bar" %}
{% assign task_id = "293b7040-6689-4eb1-8b5d-64f4d33eb2ae" %}
{% comment %} For multiple tasks use `task_ids` {% endcomment %}
{% action "event", topic: "user/foo/bar", data: data, task_id: task_id %}{% assign one_day_in_seconds = 60 | times: 60 | times: 24 %}
{% action "event" %}
{
"topic": "user/foo/bar",
"task_id": {{ task.id | json }},
"run_at": {{ "now" | date: "%s" | plus: one_day_in_seconds | json }},
"data": {
"foo": "bar"
}
}
{% endaction %}shopify/orders/create
user/orders/unpaid_reminder{% if event.preview %}
{% assign order = hash %}
{% assign order["id"] = 1234568790 %}
{% assign order["name"] = "#1234" %}
{% elsif event.topic == "user/orders/unpaid_reminder" %}
{% assign order = shop.orders[event.data.order_id] %}
{% endif %}
{% unless order.financial_status == "paid" %}
{% action "email" %}
{
"to": {{ order.email | json }},
"reply_to": {{ shop.customer_email | json }},
"subject": "Order {{ order.name }} still needs to be paid",
"body": "Please get in touch, stat!",
"from_display_name": {{ shop.name | json }}
}
{% endaction %}
{% assign one_day_in_seconds = 60 | times: 60 | times: 24 %}
{% action "event" %}
{
"topic": "user/orders/unpaid_reminder",
"task_id": {{ task.id | json }},
"run_at": {{ "now" | date: "%s" | plus: one_day_in_seconds | json }},
"data": {
"order_id": {{ order.id | json }}
}
}
{% endaction %}
{% endunless %}shopify/orders/create
user/orders/unpaid_reminder+1.day{% if event.preview %}
{% assign order = hash %}
{% assign order["id"] = 1234568790 %}
{% assign order["name"] = "#1234" %}
{% elsif event.topic == "user/orders/unpaid_reminder" %}
{% assign order = shop.orders[event.data.order_id] %}
{% endif %}
{% unless order.financial_status == "paid" %}
{% action "email" %}
{
"to": {{ order.email | json }},
"reply_to": {{ shop.customer_email | json }},
"subject": "Order {{ order.name }} still needs to be paid",
"body": "Please get in touch, stat!",
"from_display_name": {{ shop.name | json }}
}
{% endaction %}
{% assign one_day_in_seconds = 60 | times: 60 | times: 24 %}
{% action "event" %}
{
"topic": "user/orders/unpaid_reminder",
"task_id": {{ task.id | json }},
"data": {
"order_id": {{ order.id | json }}
}
}
{% endaction %}
{% endunless %}