> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# NL- (Newsletter sign-up in the order process)

> The newsletter checkbox in the shop template: iterate over all configured newsletters, set field names and reliably detect deselection.

The most convenient way to gain a newsletter subscriber is a checkbox in the order process. The tags with the prefix `NL-` are provided for this.

They belong in the shop's templates, not in the E-Marketing Manager. The newsletters themselves, to which the checkboxes refer, are defined in the shop configuration `shop.config`.

Guide: E-Marketing Manager

## The complete example

`NL-Data` is both the check whether any newsletters exist and the loop over all configured ones.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{NL-Data}
   <fieldset>
      <legend>Newsletter</legend>

      {@NL-Data}
         <input type="checkbox"
                id="~NL-Input~"
                name="~NL-Input~"
                ~NL-Checked~>
         <label for="~NL-Input~">~NL-Name~</label>

         <input type="hidden" name="~NL-ProofDeselect_hiddeninput~" value="yes">
      {/@NL-Data}
   </fieldset>
{/NL-Data}
```

> [!WARNING]
>
> The hidden field `NL-ProofDeselect_hiddeninput` belongs with every checkbox. A browser does not send a **deselected** checkbox at all. Without the hidden field, the shop therefore cannot tell whether the buyer has withdrawn consent or whether the checkbox simply was not on this page. An unsubscription would then be lost.

| Tag | Returns |
| - | - |
| `NL-Data` | the check for existing newsletters and the loop over them |
| `NL-Name` | the configured name of the newsletter |
| `NL-ID` | the configured identifier |
| `NL-Input` | the field name of the checkbox |
| `NL-Checked` | `checked` if this newsletter is selected |
| `NL-ProofDeselect_hiddeninput` | the field name of the associated hidden field |

## The default selection

`NL-Checked` outputs `checked` if the buyer has selected the newsletter. If the buyer has not made any selection yet, the default from the shop configuration applies.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@NL-Data}
   <input type="checkbox" id="~NL-Input~" name="~NL-Input~" ~NL-Checked~>
   <label for="~NL-Input~">~NL-Name~</label>
{/@NL-Data}
```

> [!WARNING]
>
> A pre-checked checkbox is legally sensitive. Whether the default may be set in the shop depends on the country of operation and the type of newsletter. Clarify this before you activate it.

> [!NOTE]
>
> `NL-Checked` can also be used as a range tag. This lets you show additional notes only when the newsletter is selected or only when it is deselected.

## Addressing individual newsletters

As range tags, `NL-Name` and `NL-ID` compare the current newsletter with the value in the parentheses. This lets you display one of several newsletters differently.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@NL-Data}
   {NL-ID(kundennews)}
      <p class="hervorgehoben">Unser Hauptnewsletter, einmal im Monat.</p>
   {/NL-ID(kundennews)}

   <input type="checkbox" id="~NL-Input~" name="~NL-Input~" ~NL-Checked~>
   <label for="~NL-Input~">~NL-Name~</label>
   <input type="hidden" name="~NL-ProofDeselect_hiddeninput~" value="yes">
{/@NL-Data}
```

> [!NOTE]
>
> The comparison is not case-sensitive. `{NL-ID(KundenNews)}` and `{NL-ID(kundennews)}` match equally.

> [!WARNING]
>
> Compare using `NL-ID`, not `NL-Name`. The name is display text and can change; the identifier stays the same.

## No newsletter configured

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{!NL-Data}
   <!-- Kein Newsletter eingerichtet, der ganze Block entfällt -->
{/!NL-Data}
```

> [!NOTE]
>
> The outer `{NL-Data}` range keeps the heading and frame off the page as long as no newsletter is set up. Without it, an empty box appears in the order process.

## The tags at a glance

| Tag | Single tag | Range tag | Negative range tag | Loop tag |
| - | - | - | - | - |
| `NL-Data` | – | yes | yes | yes |
| `NL-Name()` | yes | yes | yes | – |
| `NL-ID()` | yes | yes | yes | – |
| `NL-Input` | yes | yes | yes | – |
| `NL-Checked` | yes | yes | yes | – |
| `NL-ProofDeselect_hiddeninput` | yes | yes | yes | – |

All tags are permitted on all templates of the order process, in each case within the `NL-Data` loop.

> [!NOTE]
>
> Only `NL-Name()` and `NL-ID()` evaluate a parameter. For the other tags, the range only checks whether a value exists at all.

## Related topics

* Guide: E-Marketing Manager
* Materials: Materials for the E-Marketing Manager
* Reference: E-NL- (Page states and messages)
* Guide: Additional checkbox for data sharing


## Related topics

- [E-NL- (Page states and messages)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-nl/seitenzustaende-und-meldungen.md)
- [Newsletter vouchers](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/newsletter-gutscheine.md)
- [E-NL- (Sign-up form)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-nl/anmeldeformular.md)
- [newsletter - Newsletter](https://dokumentation.websale.de/en/konfiguration/newsletter-newsletter.md)
- [E-NL- (Managing the subscription)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-nl/abonnement-verwalten.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.