# Preview Personalized Newsletter

Previews a published newsletter email personalized for one contact, including placeholders and signature. Unpublished edits are not shown; preview-email-editor shows the draft instead. AI previews may consume credits. For a split test specify messageId. Sends nothing and changes no contact. Campaign and notification emails use preview-personalized-email.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "newsletterId": {
      "type": "integer",
      "description": "ID of the email newsletter",
      "minimum": 1
    },
    "contactId": {
      "type": "integer",
      "description": "ID of the contact to personalize for, from search-contacts or get-contact",
      "minimum": 1
    },
    "referenceId": {
      "type": "integer",
      "description": "Reference of the contact's subscription; 0 for the default one",
      "default": 0,
      "minimum": 0
    },
    "messageId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "For a split test: messageId of the variant, from get-newsletter-split-test; omit otherwise",
      "default": null,
      "minimum": 1
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account of the access token",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "newsletterId",
    "contactId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "subject",
    "html",
    "plain",
    "contentType",
    "signatureId",
    "signatureName"
  ],
  "properties": {
    "subject": {
      "type": "string"
    },
    "html": {
      "type": "string"
    },
    "plain": {
      "type": "string"
    },
    "contentType": {
      "type": "integer"
    },
    "signatureId": {
      "type": "integer"
    },
    "signatureName": {
      "type": "string"
    }
  }
}
```

