# removeEmailTemplateVariant mutation


`removeEmailTemplateVariant` is a GraphQL mutation of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Removes one variant of the template. Call it with the `version` you read.

- Requires the `emailTemplate.manage` permission.
- `NOT_FOUND` (field `language`) when the template has no such variant.
- `VALIDATION` with reason `LAST_VARIANT` when it is the template's only variant. A `JSON`
  template's all-languages variant always is.
- `CONFLICT` with reason `TEMPLATE_CHANGED` when somebody saved the template after you read it.

## Arguments

- `input`: [`RemoveEmailTemplateVariantInput!`](/chameleoon-max/type/remove-email-template-variant-input) · required

## Returns

[`EmailTemplate!`](/chameleoon-max/type/email-template)

## Example

**Mutation**

```graphql
mutation removeEmailTemplateVariant($input: RemoveEmailTemplateVariantInput!) {
  removeEmailTemplateVariant(input: $input) {
    id
    code
    name
    builtIn
    resourceKind
    syntax
    variants {
      language
      subject
      htmlBody
      textBody
      design
    }
    languages
    allLanguages
    texts(first: 10) {
      totalCount
    }
    defaultTo
    defaultCc
    defaultBcc
    defaultAttachments
    copiedFrom
    version
  }
}
```

**Variables**

```json
{
  "input": {
    "code": "example",
    "version": 1
  }
}
```

**Response**

```json
{
  "data": {
    "removeEmailTemplateVariant": {
      "id": "00000000-0000-4000-8000-000000000001",
      "code": "example",
      "name": "example",
      "builtIn": true,
      "resourceKind": "NONE",
      "syntax": "HTML",
      "variants": [
        {
          "language": "example",
          "subject": "example",
          "htmlBody": "example",
          "textBody": "example",
          "design": {}
        }
      ],
      "languages": [
        "example"
      ],
      "allLanguages": true,
      "texts": {
        "totalCount": 1
      },
      "defaultTo": "CUSTOMER",
      "defaultCc": [
        "example"
      ],
      "defaultBcc": [
        "example"
      ],
      "defaultAttachments": [
        "ORDER_INVOICE_PDF"
      ],
      "copiedFrom": "example",
      "version": 1
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
