---
title: "Using Variables"
url: https://docs.mailbeast.ai/en/articles/48-using-variables
collection: "Campaigns & Sequences"
updated: 2026-11-28
language: en
---

# Using Variables

Variables let you personalize each email with data specific to the recipient. Instead of sending the same generic message to everyone, MailBeast replaces `{{variable_name}}` with that lead's actual value at send time.

* * *

## How variables work

Write `{{variable_name}}` anywhere in the subject or body. When the email is sent, MailBeast swaps it for the lead's data.

```
Hi {{first_name}}, I noticed {{company_name}} is hiring {{custom_role}}.
```

becomes

```
Hi Sarah, I noticed Acme Corp is hiring senior engineers.
```

> **Info:** Variable names are **lowercase with underscores between words** - `first_name`, `company_name`, `linkedin_profile`. The variable picker inserts them in this exact form. If you type `{{firstName}}` (or any other variation) by hand it won't resolve and the email goes out with a blank where the name should be.

* * *

## Available variables

There are three kinds: **standard contact fields**, **custom variables** (driven by the columns in your CSV) and **sender variables** (taken from the mailbox that sends the email).

### Standard contact fields

Available for every campaign. The picker lists a standard field only when at least one lead has a value for it.

<table style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Variable</p></th><th colspan="1" rowspan="1"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>{{first_name}}</code></p></td><td colspan="1" rowspan="1"><p>First name</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{last_name}}</code></p></td><td colspan="1" rowspan="1"><p>Last name</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{full_name}}</code></p></td><td colspan="1" rowspan="1"><p>First + last name</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{company_name}}</code></p></td><td colspan="1" rowspan="1"><p>Company name</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{job_title}}</code></p></td><td colspan="1" rowspan="1"><p>Job title</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{website}}</code></p></td><td colspan="1" rowspan="1"><p>Company website</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{linkedin_profile}}</code></p></td><td colspan="1" rowspan="1"><p>LinkedIn profile URL</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{location}}</code></p></td><td colspan="1" rowspan="1"><p>Lead's location (whatever format you imported - city, country, "City, Country", etc.)</p></td></tr></tbody></table>

> **Info:** **`{{email}}`** and **`{{full_name}}`** aren't offered in the picker, but both work if you type them. `{{email}}` is the recipient's address - rarely something to repeat back at them inside the email body.

### Sender variables

These come from the mailbox that sends the email - the **First Name** and **Last Name** in that email account's **Sender Settings** (see [Account Settings](https://docs.mailbeast.ai/en/articles/11.md)). They're always in the picker, so one template signs off correctly from every mailbox in the campaign.

<table style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Variable</p></th><th colspan="1" rowspan="1"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>{{senderFirstName}}</code></p></td><td colspan="1" rowspan="1"><p>First name of the sending mailbox</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{senderLastName}}</code></p></td><td colspan="1" rowspan="1"><p>Last name of the sending mailbox</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>{{senderFullName}}</code></p></td><td colspan="1" rowspan="1"><p>First + last name of the sending mailbox</p></td></tr></tbody></table>

> **Info:** **Other system values (current date, campaign name, etc.) aren't supported.** If you need that kind of value, bake it into your template or use a custom column.

### Custom variables (from your CSV)

Any column in your imported CSV that isn't one of the standard fields becomes a custom variable named `{{custom_<slug>}}`. The slug is the column header in lowercase, with every run of spaces or other non-letter, non-digit characters turned into a single `_` and any `_` at the start or end removed (up to 64 characters; it must start with a letter) - **"Recent Funding"** in your CSV becomes `{{custom_recent_funding}}`, **"Pain Point"** becomes `{{custom_pain_point}}`.

If your CSV has these headers:

```csv
email,first_name,company_name,job_title,recent_funding,pain_point
```

Then the variables available in the editor are:

-   `{{first_name}}` (standard)
    
-   `{{company_name}}` (standard)
    
-   `{{job_title}}` (standard)
    
-   `{{custom_recent_funding}}`
    
-   `{{custom_pain_point}}`
    

A real-world template might read:

```
Subject: Quick thought for {{company_name}}

Hi {{first_name}},

Saw the {{custom_recent_funding}} announcement - congratulations.

As {{job_title}}, you probably deal with {{custom_pain_point}}. We help
companies like {{company_name}} solve this in under a week.

Worth a 15-min chat?
```

Each lead gets their own version, rendered from their row.

* * *

## Image-URL variables

A custom column can be marked as an **Image URL** instead of plain text. The value is still a URL in the CSV, but MailBeast wraps it in an `<img>` tag at send time so recipients see the actual image, not a raw link.

<table style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1" style="vertical-align: middle;"><p>Type</p></th><th colspan="1" rowspan="1" style="vertical-align: middle;"><p>Inserted as</p></th><th colspan="1" rowspan="1" style="vertical-align: middle;"><p>Rendered as</p></th></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>Text</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>{{custom_field}}</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>The literal text from the CSV</p></td></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>Image URL</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>{{custom_field}}</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>An <code>&lt;img&gt;</code> element fetched from that URL</p></td></tr></tbody></table>

### When to use it

-   **Per-lead logos / avatars** - personalize each email with the recipient's company logo or photo, fetched from a service like Clearbit or Hyperise.
    
-   **Product screenshots / landing-page previews** - show a personalized screenshot relevant to the prospect.
    
-   **Animated video thumbnails** - tools like Sendspark, Vidyard, and Loom output animated GIF thumbnails. Drop the URL in an Image URL column, wrap it in a clickable link, and recipients see what looks like an auto-playing video preview.
    

### How to mark a column as Image URL

-   **During CSV import:** on the column-mapping screen, set the column's type to **Custom Variable** - a `Text | Image URL` toggle appears. Pick **Image URL**. MailBeast preselects Image URL on column names that obviously look like images (`logo_url`, `avatar`, etc.).
    
-   **Editing a lead manually:** in the Edit Lead panel, **Custom Fields** section, click **\+ Add**, name the field, then use the type toggle to select **Image URL** before entering the URL.
    

### Valid values

-   An **absolute URL** with `https://` or `http://`. Protocol-relative or relative paths won't render.
    
-   A direct image (`.jpg`, `.png`, `.gif`, `.webp`) or a service endpoint that returns an image (Clearbit, Hyperise, etc.).
    
-   **Not a video file** - email clients don't reliably render `<video>` tags. Use the thumbnail-image-with-link pattern instead.
    

If a lead has no value in an Image URL column, MailBeast removes the `<img>` tag entirely from that lead's email rather than sending a broken-image icon.

### Personalized video pattern

Email clients strip `<video>` tags. Every personalized-video tool (Sendspark, Vidyard, Loom, Hippo Video, Bonjoro) follows the same recipe: send an animated thumbnail image and link it to a landing page where the video actually plays.

To replicate in MailBeast:

1.  In your CSV, include two columns per lead:
    
    -   `video_thumbnail` - animated GIF URL (mark as Image URL).
        
    -   `video_link` - URL of the landing page (Text type).
        
2.  Wrap the image in the link in your template (use the **<>** HTML toggle in the editor toolbar):
    

```html
<a href="{{custom_video_link}}">
  <img src="{{custom_video_thumbnail}}" alt="Watch video">
</a>
```

Recipients see what looks like a playing video preview that takes them to the landing page on click.

### Hosting your images

**Works:**

-   **Cloudinary, Imgix** - CDN with a free tier, clean URLs.
    
-   **Service-generated URLs** - Clearbit Logo API, Hyperise, Sendspark, Vidyard, Loom (the URL they hand you is fine to drop straight in the CSV).
    

**Doesn't:**

-   **Dropbox share links** - redirect to a preview page, not the image itself.
    
-   **Auth-gated URLs** (private S3, signed URLs that expire) - the URL may be invalid by the time the recipient opens the email.
    

* * *

## Inserting variables

Two ways, both end up at the same picker:

-   **Toolbar button.** Click **{{Var}}** on the right side of the editor toolbar (or **Variables** at the top right of the editor) to open the picker, then click any row to insert it at the cursor.
    

![Variables popover open in the editor showing first\_name, last\_name, company\_name and website with sample values from a real lead](https://mailbeast.ai/help/05-campaigns-sequences/sequence-builder-variables.png "Variables popover open in the editor showing first_name, last_name, company_name and website with sample values from a real lead")

-   **Type `{{` in the body.** Just typing the two opening braces inline pops up the same picker right at the cursor - no need to break flow and click the toolbar. Continue typing to filter (`{{comp` narrows to `company_name` etc.), or click a suggestion. Insertion replaces your typed `{{` with the proper variable token.
    

![Editor body showing the variable autocomplete dropdown that appears after typing two opening braces, with company\_name and website sample values visible and PII sample values blurred](https://mailbeast.ai/help/05-campaigns-sequences/sequence-builder-variables-trigger.png "Editor body showing the variable autocomplete dropdown that appears after typing two opening braces, with company_name and website sample values visible and PII sample values blurred")

Both paths show a **sample value** next to each variable - pulled from a real lead in your campaign - so you can see what each variable will produce before inserting. Image-URL variables show with a small image badge so you can tell them apart from text fields.

* * *

## What if a lead is missing a field?

When a `{{variable}}` doesn't have a value for a particular lead, MailBeast **strips the placeholder out** of that lead's email rather than leaving `{{variable}}` visible. So `Hi {{first_name}},` with an empty first name renders as `Hi ,` - which still looks broken. There's no fallback syntax for a default value, and a misspelled or unknown variable renders empty the same way.

**The defences are upstream of the template:**

1.  **Use the variable picker** - it hides standard fields that are empty on every lead (custom fields always appear), but it doesn't tell you the _fill rate_ of each field. Open the lead list and skim the column to confirm most rows have data before relying on it in your subject or first sentence.
    
2.  **Don't put fragile variables in the subject line.** A blank subject is the fastest way to look like spam. Stick to high-fill fields (`{{first_name}}`, `{{company_name}}`) for subject lines, and reserve enrichment fields (`{{custom_recent_funding}}`, `{{custom_pain_point}}`) for the body where a missing one degrades more gracefully.
    
3.  **Use** [**spintax**](https://docs.mailbeast.ai/en/articles/49.md) **for graceful degradation.** If `{{custom_pain_point}}` is only filled for half your list, you can write the sentence as `{{first_name}}, scaling outreach is a constant headache.` for the empty half and `{{first_name}}, {{custom_pain_point}} is a constant headache.` for the filled half - or, more practically, segment those leads into a separate campaign whose copy doesn't depend on the missing field.
    
4.  **Use AI Mode**. With AI Mode on for a step (see [The Sequence Editor → AI assistance](./06-sequence-builder-overview.md#ai-assistance)), MailBeast personalizes each lead's email individually and writes around missing data instead of leaving gaps. AI Mode also exposes an **Edit Fallback Template** button on each AI-generated step - that template is the safety net used when AI personalization fails for a given lead.
    

* * *

## Tips

-   **Don't over-personalize.** 2-3 variables per email is the sweet spot. Ten variables in a short email feels creepy, not personal.
    
-   **Variable names match exactly what the picker shows.** Lowercase, underscores between words: `{{first_name}}` resolves, `{{firstName}}` or `{{First_Name}}` does not.
    
-   **High-fill fields (90%+) are safe in the subject line.** First name and company name almost always have values. Enrichment fields (`{{custom_*}}`) depend entirely on what your CSV had - check fill rate before relying on them.
    
-   **Don't create a variable for data only a handful of leads have.** If only 5 of 500 leads have a `recent_funding` value, your template falls apart for the other 495. Either segment those into their own campaign, or use [spintax](https://docs.mailbeast.ai/en/articles/49.md) to compose around the gap.
    
-   **Keep custom field names simple and consistent across CSVs.** `recent_funding` is fine; `Recent Funding (announcement)` becomes `custom_recent_funding_announcement` and clutters the picker.
    
-   **Test against real leads.** Use the **Preview** button on the editor and pick a real lead - that catches broken merges, unfilled fields, and awkward formatting before you launch.
    

* * *

## Next Steps

-   [Adding Leads to a Campaign](https://docs.mailbeast.ai/en/articles/42.md) - the CSV columns you import are what becomes available as `{{custom_*}}` variables.
    
-   [Spintax Guide](https://docs.mailbeast.ai/en/articles/49.md) - combine variables with random variations for unique emails per lead.
    
-   [Sending Test Emails](https://docs.mailbeast.ai/en/articles/52.md) - preview each step against a real lead before launching.
