# Abandon Delivery

Abort a delivery from within a Liquid template, intentionally and explicitly. Use this when your template logic determines that the notification should not be sent for the current recipient.

* Tag name: `abandon_delivery`
* Effect: immediately aborts template rendering and marks the delivery as Abandoned
* Retries: none (intentional non-send)
* Impressions: not counted

When to use

* A required resource didn’t resolve (e.g., a remote fetch didn’t produce usable data).
* Business rules exclude this recipient (e.g., entitlement or audience checks).

Syntax

* Control tag form:
  * {% abandon\_delivery %}

Notes

* The tag must be executed to take effect; place it in branches that should abort.
* It does not render any output; rendering stops immediately.

Patterns

Abort when content wasn’t found

```
{% remote_fetch 'https://cms.example.com/resolve?path={{landing_url}}' alias:doc %}
{% if doc %}
  Read now
{% else %}
  {% abandon_delivery %}
{% endif %}
```

Abort on entitlement check

```
{% remote_fetch 'https://paywall.example.com/entitlements?user_id={{profile.user_id}}&doc_id={{landing_url}}' alias:ent %}
{% if ent and ent.allowed %}
  Read now
{% else %}
  {% abandon_delivery %}
{% endif %}
```

Abort for audience rule

```
{% if profile.country_code != 'US' %}
  {% abandon_delivery %}
{% endif %}
```

Behavior and observability

* Rendering stops immediately when the tag executes.
* The delivery is recorded as Abandoned (intentional).

Authoring guidance

* Place the tag inside the else (or unless) branch of your decision logic so it only triggers when appropriate.
* Keep decision logic simple and explicit so intent is clear in reviews and analytics.

FAQ

* Can I place it outside an if/else?
  * Yes, but it will always abort. It’s best used conditionally.
* Does it print anything?
  * No; it halts rendering immediately.

Troubleshooting

* “It didn’t abort”: Ensure the branch containing the tag actually executed (verify your conditions and aliases).
