Email blocks in Campaign Agent
This article explains how Campaign Agent builds and manages your email block library, how to import and update blocks, and how to fix common block issues.
Campaign Agent doesn't generate email designs or images from scratch. Instead, it reuses blocks from your existing email designs — assembling and personalizing them for each new campaign. The quality of your output depends on the quality of your existing blocks.
How Campaign Agent builds your block library
The first time you open Campaign Agent in a project, it automatically scans your existing email campaigns in the background. You can start using Campaign Agent immediately while the scan runs.
Campaign Agent looks through lifecycle campaigns triggered by event or repeat, and tries to capture at least one version of each of the 11 block types it recognizes:
- header, footer, hero banner
- product grid, product detail listing, single product spotlight
- heading, text block, image, CTA button, spacer
For each candidate email, Campaign Agent:
- Identifies the base email template — global styles, font imports, the main content area, and background definitions.
- Slices the email body into individual blocks.
- Identifies each block's purpose — its type and description.
- Marks editable elements with parameters so they can be modified in the editor.
- Collapses product grids into a repeatable product card.
- Tests each block against the base template for style compatibility.
- Saves approved blocks to Asset Manager with the
[CAMPAIGN AGENT]prefix.
The scan continues until it has enough distinct blocks or has reviewed around 20 campaigns. The time it takes depends on the size and complexity of your email library. Campaign Agent tries to remove near-identical duplicates, but some may still appear.
If a block type isn't found, Campaign Agent uses built-in default blocks so emails still look complete. Once a custom block of a given type exists in your library, the default for that type is no longer used.
NoteTreat the automatic scan as a starting point, not a guaranteed migration of all your existing designs. Review your block library after the scan completes and import any missing blocks manually.
Manage your block library
You can add or update blocks in two ways.
Import a full email design
Pick an existing email template from Asset Manager or paste raw HTML. Campaign Agent runs the same process as the automatic scan — identifying block types, marking editable elements with parameters, and saving blocks with the [CAMPAIGN AGENT] prefix.
This option replaces all previously saved blocks and the base template and can't be undone automatically. You can only undo this manually in Asset Manager by restoring the previous base template and blocks.
Use this when your existing design is outdated and you want to replace the entire block library.
Import individual blocks
Import a single block from Asset Manager as a custom row. This adds the block to your library without replacing existing blocks.
When you import a block, Campaign Agent generates a preview for a test customer and analyzes the resulting HTML to identify the block type, editable elements, links, images, styles, and repeatable rows and columns. The block is saved with the [CAMPAIGN AGENT] prefix and appears in the block picker.
NoteEach custom row should contain a single block — one clear visual module. Rows with multiple modules in one block lead to incorrect block descriptions and broken styles.
Use this when a specific block type is missing from your library and you want to add it without affecting existing blocks.
Common block issues
The following issues can occur after the automatic scan or after importing blocks manually. For most issues, re-importing the block resolves the problem. If it doesn't, edit the block parameters directly in Asset Manager.
| Issue | What you see | How to fix |
|---|---|---|
| Scan failed | Error shown on the Campaign Agent home screen | Import a specific email template manually from Asset Manager. |
| Two visual modules treated as one block, or one block split into two | Heading bundled with product block, or hero title separated from hero image | Re-import from a source email with a cleaner structure, or import the block as a standalone custom row from Asset Manager. |
| Block not editable as expected | Text, image, or button URL can't be changed in the editor | Re-import the block, or fix the block parameters manually in Asset Manager. |
| Product grid has wrong number of columns or doesn't match the original layout | Grid layout looks incorrect in preview | Re-import the block, or fix the block parameters manually in Asset Manager. |
| Block looks wrong in the email — width mismatch or font and color clash | Block appears broken in preview | Re-import the block, or fix the block parameters manually in Asset Manager. |
NoteAn imported block may behave differently from the original — for example, complex conditional layouts may not be reproduced. This is expected. Campaign Agent renders the block for a test customer and analyzes the resulting HTML rather than replicating the original Jinja logic.
Fix blocks manually in Asset Manager
If re-importing a block doesn't resolve the issue, you can edit the block directly in Asset Manager.
Campaign Agent blocks are stored as custom HTML blocks with the [CAMPAIGN AGENT] prefix. Each block contains parameters — markers that tell Campaign Agent which elements can be edited and how.
![Asset Manager Blocks tab showing two blocks with the [CAMPAIGN AGENT] prefix.](https://files.readme.io/69aa2c9be1e2b0290121749bf5d0894088e55973d836252642635fe7719c4690-image.png)
When Campaign Agent scans or imports a block, it:
- Takes a visual snapshot of the block rendered for a test customer. It doesn't carry over the block's original Jinja logic — some custom logic, such as conditional column counts or conditional layouts, is lost.
- Marks editable elements with parameters.
- Detects system links —
{{ consent.page }},{{ email.view }},{{ email.unsubscribe }}— and implements them using standard defaults. To change the default behavior, update the block description or the parameter value.
Each block also has a description and parameter descriptions that instruct Campaign Agent on how to use it — for example, "max 20 characters" or "recommended for at most 3 rows of products."
For product grids, include the maximum column count in the block description — for example, "Max. 2 columns" — otherwise Campaign Agent may exceed the layout limit.
To fix and test a block:
- Find the block in Asset Manager — look for custom blocks with the
[CAMPAIGN AGENT]prefix. - Edit the block parameters. For parameter syntax and reference, see Email block parameters in Campaign Agent.
- Save the block.
- Add the updated block manually to an email in Campaign Agent to verify it renders correctly and is editable.
- For product blocks, ask Campaign Agent to display products — for example: "Show bestsellers in this block" — to confirm the block behaves as expected.
NoteUpdating a block in Asset Manager doesn't automatically update existing campaigns that use it. To apply the updated block to an existing campaign, add it manually or ask Campaign Agent conversationally to use the newest version of the block.

