function
Syntax
{% function "function_handle", param1:value1, param2:value2 as result %}Parameters
{% assign user_email = "[email protected]" %}
{% function "send_email", email:user_email, subject:"Welcome!" as email_result %}{% comment %}Inside webhook orders/paid script{% endcomment %}
{% assign order = payload %}
{% function "create_order_note", order_id:order.id, message:"Note text", priority:"high", notify:true as note_result %}
{% log note_result %}Return values
Without as
asExample: Send metrics to Klaviyo
Example: Reusable GraphQL helper
Example: Calling a function inside a loop
Legacy format: JSON payload
Limitations
Last updated