# How do I edit email templates?

URL: https://help.hubhus.com/kb/how-do-i-edit-email-templates
Category: Messaging & Communication / Email
Updated: 2026-09-28T14:40:30.413+00:00

Summary: Campaign settings → Emails → New template → Edit. Use CTRL+K / CMD+K to insert placeholders. Use Hubhus @if-syntax (not standard code) for dynamic content. Apply a layout for branding. Test with a real lead before activating. Check spam rules if emails aren't sending.

Build and modify email templates with the Hubhus template editor - preview with real lead data, search placeholders with CTRL+K, add conditional logic with @if, and test before activating.

## Get started in 4 steps

1. Go to **Campaign settings → Emails → New Email Template**. Set a name, sender details, and subject line. Click **Edit** to open the template editor.
2. Write your email body. Use **CTRL+K / CMD+K** to search and insert placeholders - lead data, event info, assigned person, checklists, files, and more.
3. Add dynamic logic with `@if` where needed (e.g. show different text based on postal code, lead type, or assigned person). Optional: apply a layout for consistent branding.
4. **Test with a real lead** using the preview in the editor. Send a test email and verify the output. Then activate the template in your automation or action listener.

**Placeholders:** CTRL+K / CMD+K · **Recipient:** use `%lead_email%` or `%assigned_person_email%` · **Deep guide:** [Working with the template editor](https://help.hubhus.com/kb/working-with-the-template-editor)

**Read more**

### @if / @else logic - Hubhus syntax

```
@if(%assigned_person_email%){
  Your consultant: %assigned_person_name%
}@else{
  Contact us at support@yourcompany.com
}@endif
```

**Supported operators:** `==` `!=` `~=` (contains, case-insensitive) `>=` `<=` `>` `<` **Logical:** || and `&&` - note: || is evaluated before `&&`. Parentheses are not supported.

### Recipient fields and conditional sending

All recipient fields (To, CC, BCC, From, Reply-to) support dynamic placeholders and @if logic. Example with fallback:

```
@if(%assigned_person_email%){
  %assigned_person_email%
}@else{
  %brand_contact_email%
}@endif
```

**Conditional send requirement:** the template only sends if this evaluates to truthy:

```
@if(%lead_postal_code% == 2000){1}@endif
```

### Spam protection rules

Each template has configurable limits: max emails per lead, max per email address, blacklist/whitelist campaigns, frequency limits (e.g. max 1 per hour), and unsubscribe handling. If emails aren't sending, always check these rules first.

### HTML email best practices

- Use `<table>`-based layout - most email clients require it
- Keep all styles inline
- Use absolute URLs for images
- Close all tags
- Avoid flexbox, grid, external stylesheets, and JavaScript
- Use Hubhus HTML components for reusable headers/footers

## Related articles

- https://help.hubhus.com/kb/working-with-the-template-editor
- https://help.hubhus.com/kb/creating-and-managing-nps-surveys
- https://help.hubhus.com/kb/how-do-i-send-emails-to-specific-recipients
- https://help.hubhus.com/kb/how-do-i-set-up-automated-email-flows
- https://help.hubhus.com/kb/why-are-my-emails-not-being-sent
- https://help.hubhus.com/kb/how-do-i-show-different-content-based-on-lead-data
