> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revbridge.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Templates

> Create and manage message templates across all channels

Templates are the content of your marketing messages. RevBridge AI helps you create, manage, and optimize templates for Email, SMS, WhatsApp, and Push notifications.

## Overview

Access Templates from **Assets → Templates** in the sidebar. Here you can:

* Browse and search existing templates
* Create new templates manually
* Generate templates with AI
* Edit templates with the visual email editor
* Organize with favorites, filters, and bulk operations

## Browsing Templates

The Templates page displays a responsive card grid with:

* **Filtering**: Filter by channel type (Email, SMS, WhatsApp, Push) and status (Active, Draft, Archived)
* **Smart Search**: Search across template names, subjects, descriptions, and content with relevance-based ranking
* **Infinite Scroll**: Templates load 20 at a time as you scroll, with a progress bar showing loaded vs. total count
* **Favorites**: Star templates for quick access — favorites are persisted locally and appear first in your grid

### Smart Search

The search ranks results by relevance:

1. **Name match** (highest priority)
2. **Subject line match**
3. **Description match**
4. **Content match** (HTML stripped before matching)
5. **Multi-word partial matches**

Results show a count indicator like "12 results for 'welcome'" and are sorted by relevance, then by most recently updated.

## AI Template Generation

RevBridge AI can generate templates automatically using your brand guidelines.

### How It Works

1. AI reads your **Brand Dossier** (colors, fonts, voice)
2. Applies a **Creative Concept** (rational/emotional appeal)
3. Generates channel-appropriate content
4. Includes your logo and brand colors

### Generating Templates

From the Templates page, click **Generate Templates** to open the AI generation wizard:

<Steps>
  <Step title="Define Goal">
    Enter your campaign goal and select which channel(s) to generate for
  </Step>

  <Step title="Watch Generation">
    The AI generates templates in real-time via streaming. You can see each creative concept's generation status as it progresses
  </Step>

  <Step title="Review and Approve">
    Review each generated template one by one. Use keyboard shortcuts for fast review:

    * `A` — Approve template
    * `R` — Reject template
    * `S` — Skip template
    * `←` / `→` — Navigate between templates

    Only approved templates are saved to your library
  </Step>
</Steps>

### Creative Concepts

Each generated template uses one of 6 creative concepts:

| Code      | Name                | Approach                              |
| --------- | ------------------- | ------------------------------------- |
| **CC-01** | Financial Rational  | Discounts, savings, price comparisons |
| **CC-02** | Financial Emotional | Urgency, FOMO, limited-time offers    |
| **CC-03** | Social Rational     | Reviews, testimonials, ratings        |
| **CC-04** | Social Emotional    | Community, trending, exclusivity      |
| **CC-05** | Personal Rational   | Personalized recommendations          |
| **CC-06** | Personal Emotional  | Storytelling, emotional connection    |

<Tip>
  Generate all 6 concepts for AI Campaigns. The MAB algorithm will determine which resonates best with your audience.
</Tip>

### Default Template Types

Pre-configured templates for common use cases:

| Type                   | Concept                     | Purpose                        |
| ---------------------- | --------------------------- | ------------------------------ |
| **Welcome**            | CC-04 (Social Emotional)    | First-time customer engagement |
| **Browse Abandonment** | CC-02 (Financial Emotional) | Re-engage product viewers      |
| **Cart Abandonment**   | CC-01 (Financial Rational)  | Recover abandoned carts        |
| **Post-Purchase**      | CC-05 (Personal Rational)   | Encourage repeat purchase      |
| **Reactivation**       | CC-01 (Financial Rational)  | Win back inactive customers    |
| **Promotional**        | CC-02 (Financial Emotional) | Flash sales and promotions     |

## Template Formats by Channel

### Email Templates

Full HTML templates with:

* Responsive design (mobile-friendly)
* Brand colors and typography
* Logo placement
* Images and graphics
* Call-to-action buttons
* Unsubscribe link (required)

### SMS Templates

Plain text messages:

* 160 character limit recommended
* No HTML or formatting
* Include opt-out instructions
* Short URLs for links

Example:

```
{{first_name}}, your cart is waiting! Complete your purchase and save 10%.
Shop now: {{short_url}} Reply STOP to opt out
```

### WhatsApp Templates

Formatted text messages:

* Bold: `*text*`
* Italic: `_text_`
* Emojis supported
* Quick reply buttons (where supported)
* Must use pre-approved template format

Example:

```
Hi {{first_name}}!

Your order from *{{store_name}}* has shipped!

Track your package: {{tracking_url}}

Questions? Reply to this message.
```

### Push Notifications (Coming Soon)

<Info>
  Push notification templates will be available when the Push channel launches.
</Info>

Short, attention-grabbing messages:

* **Title**: 50 characters max
* **Body**: 150 characters max
* Optional image (rich push)
* Deep link URL

## Template Variables

Use variables (placeholders) that get replaced with customer data at send time.

### Common Variables

| Variable           | Description           | Example Value                               |
| ------------------ | --------------------- | ------------------------------------------- |
| `{{first_name}}`   | Customer's first name | "Sarah"                                     |
| `{{last_name}}`    | Customer's last name  | "Johnson"                                   |
| `{{email}}`        | Customer's email      | "[sarah@email.com](mailto:sarah@email.com)" |
| `{{headline}}`     | Campaign headline     | "Flash Sale Today!"                         |
| `{{body}}`         | Main message body     | Campaign content                            |
| `{{cta_text}}`     | Button text           | "Shop Now"                                  |
| `{{cta_url}}`      | Button link           | "https\://..."                              |
| `{{company_name}}` | Your company name     | "Acme Store"                                |

### E-commerce Variables

| Variable            | Description                |
| ------------------- | -------------------------- |
| `{{cart_items}}`    | Items in abandoned cart    |
| `{{cart_total}}`    | Cart value                 |
| `{{product_name}}`  | Recently viewed product    |
| `{{discount_code}}` | Personalized discount code |
| `{{order_number}}`  | Recent order number        |

### Fallback Values

Provide fallback values for when data is missing:

```
Hi {{first_name|there}},
```

If `first_name` is empty, uses "there" instead.

## Email Editor (Stripo)

Email templates use the **Stripo** drag-and-drop editor, a professional visual email builder.

### Editor Layout

The editor displays two panels:

* **Left panel**: Settings, block library, and content options
* **Right panel**: Live preview of your email

### Key Features

* **Drag-and-drop blocks**: Add text, images, buttons, spacers, social links, and more by dragging them into your email
* **HTML code editor**: Switch to raw HTML editing when you need full control
* **Mobile preview**: Preview how your email renders on mobile devices
* **Merge tag support**: Template variables like `{{first_name}}` are displayed as protected, non-editable tags in the visual editor so they don't get accidentally modified
* **CSS inlining**: When you save, CSS is automatically inlined for maximum email client compatibility

### Saving Templates

When you save an email template:

1. The editor extracts the current HTML and CSS
2. CSS is compiled and inlined via the backend
3. Both the source (editable) and compiled (send-ready) versions are stored

<Info>
  Non-email templates (SMS, WhatsApp, Push) use a simple text editor with a preview tab instead of Stripo.
</Info>

## Template Management

### Quick Edit Panel

For fast changes without leaving the templates grid:

1. Click on a template card to open the side panel
2. Edit the name, description, or status
3. Preview the rendered HTML with a hover-to-scroll animation
4. Save with `Cmd+S` (or `Ctrl+S`)

### Duplicating Templates

To create a template based on an existing one:

1. Open the action menu on a template card
2. Click **Duplicate**
3. A new template is created with the same content
4. Modify and save with a new name

### Bulk Operations

For managing multiple templates at once:

1. Click **Select** to enter selection mode
2. Checkboxes appear on each template card
3. Select the templates you want to manage
4. Use the floating action bar to **Delete Selected**

### Deleting Templates

**Single delete**: Open the action menu on a template card and click **Delete**. The card is removed immediately (optimistic update) and reverts if the deletion fails.

**Bulk delete**: Use selection mode to delete multiple templates at once.

<Warning>
  Templates used by active or scheduled campaigns cannot be deleted.
</Warning>

### Naming Conventions

Use a consistent naming format: `[Channel] - [UseCase] - [Concept]`

Examples:

* "Email - Cart Abandonment - CC-01"
* "SMS - Welcome - CC-04"
* "WhatsApp - Reactivation - CC-01"

### Template Versioning

When you edit a template:

* Active campaigns continue using the original version
* New campaigns use the updated version
* No automatic update to running campaigns

<Warning>
  To update a template in an active campaign, pause the campaign, update the template, then resume.
</Warning>

## Best Practices

### Keep It Concise

* Subject lines: 50 characters or less
* Email body: Scannable, key info above the fold
* SMS: Under 160 characters when possible
* Push: Get to the point immediately

### Clear Call-to-Action

Every template should have:

* One primary CTA
* Action-oriented text ("Shop Now", "Claim Offer")
* Prominent button/link placement

### Mobile First

* Over 60% of emails opened on mobile
* Use responsive email templates
* Test on multiple devices

### Brand Consistency

* Use your brand colors
* Include your logo
* Match your website's tone of voice
* AI templates automatically follow your Brand Dossier

### Test Before Launch

* Send test emails to yourself
* Preview on desktop and mobile
* Check variable rendering
* Verify links work
