> ## 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.

# IR- (BackInStockMail)

> Build the form with which a visitor signs up for notification when a product is available again, and query the number of their sign-ups.

With BackInStockMail, a visitor leaves their contact details for a product that is currently not available. If the availability status improves, the shop automatically sends them an email with a deep link to the product.

The `IR-` tags build exactly one part of this function: the form in which the visitor enters their contact details. This form is on the template entered in the shop configuration `shop.config` in the `<Templates>` section under `InventoryRegister`. One tag of the group is an exception and can be used on any template; more on this below.

The notification email itself has no `IR-` tags. It works with `A-` and `PR-` tags.

Guide: BackInStockMail · Reference: OrderNowMail section

## The contact details form

Only the email address is mandatory. Salutation, first name and last name are voluntary under the General Data Protection Regulation and should also be marked as such.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<form action="~FORM-InventoryRegister~" method="post">
   ~MSG-InventoryRegister_Notify~

   {PR-Data}
      <p>Produkt: ~PR-Name~</p>
   {/PR-Data}

   <label>Anrede ~IR-SalutationList~</label>

   <label for="~IR-FirstName_input~">Vorname</label>
   <input type="text" maxlength="128"
          id="~IR-FirstName_input~" name="~IR-FirstName_input~" value="~IR-FirstName~">

   <label for="~IR-LastName_input~">Nachname</label>
   <input type="text" maxlength="128"
          id="~IR-LastName_input~" name="~IR-LastName_input~" value="~IR-LastName~">

   <label for="~IR-Email_input~">E-Mail-Adresse *</label>
   <input type="email" maxlength="128" required
          id="~IR-Email_input~" name="~IR-Email_input~" value="~IR-Email~">

   <button type="submit">Benachrichtigen</button>
</form>
```

> [!NOTE]
>
> Each input field consists of two tags. The `_input` tag returns the field name that the shop system expects on submission. The tag of the same name without `_input` returns the value with which the field is prefilled.

> [!WARNING]
>
> Never write the field names by hand. They are fixed in the shop system, and a different name causes the field to be lost on submission. The email address is then missing, and the sign-up fails without the visitor seeing the reason.

## The form tags

| Tag | Returns |
| - | - |
| `IR-SalutationList` | the complete selection list for the salutation, including the entries |
| `IR-FirstName_input` | the field name for the first name |
| `IR-FirstName` | the prefilled first name |
| `IR-LastName_input` | the field name for the last name |
| `IR-LastName` | the prefilled last name |
| `IR-Email_input` | the field name for the email address |
| `IR-Email` | the prefilled email address |

> [!NOTE]
>
> `IR-SalutationList` outputs the complete `select` element, not just the entries. You cannot place it in your own `select`, nor add your own entries. If you want to display the salutation differently, the only option is to omit it, since it is voluntary anyway.

## Why the values are prefilled

The three value tags are not an extra. The shop system remembers the entered contact details in the session, and for a logged-in customer they are already known anyway.

* If the same visitor signs up for a second product, the form is already filled in.
* If they are logged in to the shop, their data is in it from the start.
* If the form is displayed again due to an incorrect entry, what was typed is retained.

> [!WARNING]
>
> Therefore, don't omit the `value` attribute. Without the value tags, the visitor has to retype everything after every rejected entry.

> [!NOTE]
>
> The three value tags also work as area tags and take effect if a value is available. This lets you show, for example, a notice that the data was taken from the customer account.

## Querying the number of sign-ups

`IR-Positions` outputs for how many products the visitor currently has a notification registered. As an area tag, it takes effect as soon as there is at least one.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{IR-Positions}
   <a href="~WS-LoadTpl(ws_inventory_register_overview.htm)~">
      Ihre Benachrichtigungen (~IR-Positions~)
   </a>
{/IR-Positions}

{!IR-Positions}
   <p>Sie haben derzeit keine Benachrichtigungen aktiviert.</p>
{/!IR-Positions}
```

> [!NOTE]
>
> This tag is not described in the previous documentation. It is the direct way to show an entry point to the overview page only if there is something to see there. In the guide, the same question has so far been answered in a roundabout way using a `CAT-AdvData` area tag and a set design parameter.

> [!NOTE]
>
> `IR-Positions` is the only tag in this group that works on any template. The others belong on the `InventoryRegister` template. An obvious place is the customer account overview, although a visitor who is not logged in can also sign up.

## The tags at a glance

| Tag | Single tag | Area tag | Negative area tag | Loop tag |
| - | - | - | - | - |
| `IR-SalutationList` | yes | – | – | – |
| `IR-FirstName_input` | yes | – | – | – |
| `IR-FirstName` | yes | yes | yes | – |
| `IR-LastName_input` | yes | – | – | – |
| `IR-LastName` | yes | yes | yes | – |
| `IR-Email_input` | yes | – | – | – |
| `IR-Email` | yes | yes | yes | – |
| `IR-Positions` | yes | yes | yes | – |

The values are output HTML-encoded, so you don't need an additional `ENCHTML-`.

## Related topics

* Guide: BackInStockMail
* Guide: Displaying stock levels
* Reference: FORM- (Forms)
* Reference: MSG- (Messages)
* Reference: PR- (Product data)


## Related topics

- [BackInStockMail (OrderNow service)](https://dokumentation.websale.de/en/v8s/produkte/backinstockmail-ordernow-service.md)
- [Use cases](https://dokumentation.websale.de/en/v8s/anwendungsbeispiele/anwendungsbeispiele.md)
- [Emails](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/e-mails.md)
- [Email notifications: overview](https://dokumentation.websale.de/en/v8s/e-mails/e-mail-benachrichtigungen-ueberblick.md)
- [Products, catalog, and search](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/produkte-katalog-und-suche.md)


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