# emails-adopt

Adopt an existing application-owned email preview and verification target


## When to use it

Connect your existing email preview and test commands to Megamono. Keep the templates and theme you already use, and choose a verification command that can run without sending real email.

## Usage

```sh
npm exec -- nx generate @megamono/plugin:emails-adopt --project="<project>" --previewTarget="<previewTarget>" --verificationTarget="<verificationTarget>" --templatesRoot="<templatesRoot>" --fixturesRoot="<fixturesRoot>" --themeFile="<themeFile>" --dry-run
```

Replace angle-bracket placeholders with reviewed values. Nx's `--dry-run` previews generator writes; remove it only after reviewing the plan. Examples use npm; use your workspace's package manager if it differs.

## Options

Use these options with `@megamono/plugin:emails-adopt`. Nx uses the camelCase names shown here; the [CLI reference](/docs/cli) describes command-line aliases. Some options are required only for particular choices.

| Option | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `project` | Yes | string | — | Existing Nx email library project name. |
| `previewTarget` | Yes | string | — | Existing local-only, non-cacheable preview target. |
| `verificationTarget` | Yes | string | — | Existing target testing rendered outputs, validation, size limits and capture delivery. |
| `templatesRoot` | Yes | string | — | Workspace-relative existing template directory. |
| `fixturesRoot` | Yes | string | — | Workspace-relative directory of synthetic preview fixtures. |
| `themeFile` | Yes | string | — | Existing application-owned email/shared token file; never overwritten. |
| `reviewedLocalOnly` | No | boolean | — | Explicit review that preview binds to loopback only. |
| `reviewedFixtureOnly` | No | boolean | — | Explicit review that preview uses synthetic fixtures and no production secrets or recipients. |
| `planOnly` | No | boolean | false | Print the plan without buffering changes, including when invoked directly. |
| `yes` | No | boolean | false | Apply reviewed mapping and verification target only. |

## Next steps

Review changed files and run the affected project's checks. For options that accept structured values, run the generator's `--help` or consult the schema in the installed package.

- [All generators](/docs/generators)
- [CLI overview](/docs/cli)
- [Adopt an existing workspace](/docs/workflows/adoption)
