# Update Opt-In Confirmation Email Content

Replaces the supplied HTML or plain-text body of an opt-in confirmation email in full; omitted parts stay and may then disagree, so supply both for a consistent message. Validation errors refuse the write with stored false and validationMessages; warnings do not. This email records consent and must still identify who is subscribing to what. Change it only at the user’s request.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "optInProcessId": {
      "type": "integer",
      "description": "ID of the opt-in process whose confirmation email is written",
      "minimum": 1
    },
    "html": {
      "type": [
        "null",
        "string"
      ],
      "description": "Complete HTML body; replaces the current one, empty string makes the email plain-text only",
      "default": null,
      "maxLength": 500000
    },
    "plain": {
      "type": [
        "null",
        "string"
      ],
      "description": "Complete plain-text body; replaces the current one",
      "default": null,
      "maxLength": 500000
    },
    "subject": {
      "type": [
        "null",
        "string"
      ],
      "description": "Subject line",
      "default": null,
      "minLength": 1,
      "maxLength": 150
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "optInProcessId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "emailId",
    "optInProcessId",
    "subject",
    "contentType",
    "html",
    "plain",
    "validationMessages",
    "stored",
    "editUrl"
  ],
  "properties": {
    "emailId": {
      "type": "integer"
    },
    "optInProcessId": {
      "type": "integer"
    },
    "subject": {
      "type": "string"
    },
    "contentType": {
      "type": "string",
      "enum": [
        "plain",
        "html-and-plain"
      ]
    },
    "html": {
      "type": "string"
    },
    "plain": {
      "type": "string"
    },
    "validationMessages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "code",
          "message"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "stored": {
      "type": "boolean"
    },
    "editUrl": {
      "type": "string"
    }
  }
}
```

