Skip to content

연결된 콘텐츠 중단하기

Liquid 템플릿을 사용하면 조건 로직으로 메시지를 중단할 수 있는 옵션이 있습니다. 이 페이지에서는 모범 사례에 대해 설명합니다.

다음 예제에서 connected.recommendations.size < 5connected.foo.bar == nil 조건문은 메시징이 중단될 수 있는 상황을 지정합니다.

1
2
3
4
{% connected_content https://example.com/webservice.json :save connected %}
   {% if connected.recommendations.size < 5 or connected.foo.bar == nil %}
     {% abort_message() %}
   {% endif %}

중단 사유 지정

중단 사유를 지정할 수도 있으며, 이 사유는 메시지 활동 로그에 저장됩니다. 이 중단 사유는 문자열이어야 하며 Liquid를 포함할 수 없습니다.

{% abort_message('Could not get enough recommendations') %}

New Stuff!