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

# DA- (Deleting the customer account)

> The tags for the confirmation email for deleting a customer account: generate the confirmation link and show the buyer which account they are deleting.

If a buyer wants to delete their customer account, this does not happen immediately. The shop sends them a confirmation email, and only clicking the link in it triggers the deletion. This is the same double opt-in procedure as when changing the email address.

The tags with the prefix `DA-` belong exclusively in the HTML template of this confirmation email. They have no place on a shop page.

Guide: Login and registration, section Deleting the customer account

## The process

| Step | Where | Tag |
| - | - | - |
| The buyer requests deletion | Customer account | `WS-RequestDeleteAccountDoubleOptInEmailLink` |
| The shop sends the confirmation email | Email template from `<DeleteAccountDoubleOptInMail>` | the DA tags |
| The buyer confirms | Confirmation email | `DA-DeleteLink` |

> [!NOTE]
>
> You define the sender, subject and template of the email in the shop configuration `shop.config` in the `<DeleteAccountDoubleOptInMail>` section. Without a stored template, the shop does not send an email, and the deletion does not take place.

Reference: `<DeleteAccountDoubleOptInMail>` section

## The complete example

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<p>
   {DA-Company}~DA-Company~<br>{/DA-Company}
   {DA-FirstName}~DA-FirstName~ {/DA-FirstName}~DA-LastName~
</p>

<p>
   Sie haben die Löschung Ihres Kundenkontos angefordert.
   {DA-CustomerID}Es handelt sich um das Konto mit der Kundennummer ~DA-CustomerID~.{/DA-CustomerID}
   {DA-LastLogin}Ihre letzte Anmeldung war am ~DA-LastLogin~.{/DA-LastLogin}
</p>

<p>
   <a href="~DA-DeleteLink~">Löschung jetzt bestätigen</a>
</p>

<p>
   Wenn Sie das nicht angefordert haben, ignorieren Sie diese Nachricht einfach.
   Ohne Ihre Bestätigung bleibt Ihr Konto bestehen.
</p>
```

> [!WARNING]
>
> The notice at the end is part of it. Anyone who receives such an email unexpectedly must be able to recognise that doing nothing keeps the account.

## DA-DeleteLink

Generates the confirmation link. It applies to exactly the account whose deletion was requested.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<a href="~DA-DeleteLink~">Löschung jetzt bestätigen</a>
```

> [!WARNING]
>
> `DA-DeleteLink` is a single tag only. Bracketing with it is not possible, even though the previous documentation lists it as an area tag.

> [!WARNING]
>
> Clicking the link deletes the account without further confirmation. It already is the confirmation. Therefore, do not build an additional security prompt on an intermediate page; instead, label the link unambiguously.

## The account details

Five tags provide information about which account is concerned. They come from the billing address of the account.

| Tag | Returns |
| - | - |
| `DA-FirstName` | the first name |
| `DA-LastName` | the last name |
| `DA-Company` | the company name |
| `DA-CustomerID` | the customer number |
| `DA-LastLogin` | the time of the last login |

All five can be used as single tags and as area tags. Bracketing is worthwhile because not every account has every field filled in.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{DA-Company}
   ~DA-Company~<br>
{/DA-Company}
~DA-FirstName~ ~DA-LastName~
```

> [!NOTE]
>
> `DA-LastLogin` is the most useful of these details. A buyer who has not logged in for three years can tell from it that the email may be genuine. For an account they used yesterday, they will become suspicious if they did not request the deletion themselves.

### DA-SubAccountID

Outputs the identifier of the sub-account. You need this tag if your shop offers multiple accounts in which several accounts use the same email address.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{DA-SubAccountID}
   Betroffenes Unterkonto: ~DA-SubAccountID~
{/DA-SubAccountID}
```

> [!WARNING]
>
> Without this detail, a buyer with several accounts under one address cannot tell which of them is to be deleted. The tag is not described in the previous documentation, but it exists in the shop.

Guide: Offering a multiple account overview

## Tags of other prefixes

| Tag | Purpose | Belongs on |
| - | - | - |
| `WS-RequestDeleteAccountDoubleOptInEmailLink` | triggers the request and sends the confirmation email | Customer account |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<a href="~WS-RequestDeleteAccountDoubleOptInEmailLink~">Kundenkonto löschen</a>
```

Reference: WS-RequestDeleteAccountDoubleOptInEmailLink

## The tags at a glance

| Tag | Single tag | Area tag | Negative area tag | Loop tag |
| - | - | - | - | - |
| `DA-DeleteLink` | yes | – | – | – |
| `DA-FirstName` | yes | yes | yes | – |
| `DA-LastName` | yes | yes | yes | – |
| `DA-Company` | yes | yes | yes | – |
| `DA-CustomerID` | yes | yes | yes | – |
| `DA-LastLogin` | yes | yes | yes | – |
| `DA-SubAccountID` | yes | yes | yes | – |

All tags are permitted exclusively in the HTML email template of the "Delete customer account" function.

## Related topics

* Guide: Login and registration
* Guide: Offering a multiple account overview
* Guide: Customer account
* Reference: `<DeleteAccountDoubleOptInMail>` section


## Related topics

- [MA- (Multiple accounts)](https://dokumentation.websale.de/en/v8s/referenz/tags/ma-mehrfachkonten.md)
- [general - General shop settings](https://dokumentation.websale.de/en/konfiguration/general-allgemeine-shopeinstellungen.md)
- [Storefront API Customer Account](https://dokumentation.websale.de/en/schnittstellen/storefront-api/storefront-api-kundenkonto.md)
- [Customer, login and account](https://dokumentation.websale.de/en/v8s/referenz/tags/ws/kunde-anmeldung-und-konto.md)
- [Account](https://dokumentation.websale.de/en/frontend/referenz/aktionen/account.md)


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