> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.app-hive.dev/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to use email variables?

# Email Template Variables

Quotify uses Liquid templating in your email subject lines, messages, and custom email templates. You can insert dynamic data from quotes, proposals, and your shop using `{{ variable }}` syntax.

## Form Fields

Access any form field value by its slug:

```liquid
{{ quote.form.fields.first_name }}
{{ quote.form.fields.last_name }}
{{ quote.form.fields.email }}
{{ quote.form.fields.company }}
{{ quote.form.fields.phone }}
```

The slug matches the field name you set up in your form builder (lowercased, spaces replaced with underscores). If you created a custom field called "Project Budget", the variable would be `{{ quote.form.fields.project_budget }}`.

## Form Fieldsets

Loop through fieldsets to display all submitted form data grouped by section:

```liquid
{% for fieldset in quote.form.fieldsets %}
  <h4>{{ fieldset.title }}</h4>
  <p>{{ fieldset.description }}</p>

  {% for field in fieldset.fields %}
    <p>{{ field.name }}: {{ field.value }}</p>
  {% endfor %}
{% endfor %}
```

Each field in a fieldset has:

| Variable | Description |
| ---- |
| `field.name` | The field label (e.g. "First Name") |
| `field.type` | The field type (e.g. "email", "text") |
| `field.value` | The submitted value |

## Quote Variables

| Variable | Example | Description |
| ---- |
| `quote.id` | `vcXVvdGlm` | Unique quote reference ID |
| `quote.locale` | `en` | Language code of the quote |
| `quote.market` | `US` | Market the quote was submitted from |
| `quote.total` | `642.00` | Total amount (plain number) |
| `quote.total_formatted` | `$642.00` | Total with currency formatting |
| `quote.created_at` | `10 Feb, 2026` | Date the quote was submitted |

### Quote Products

Loop through the products included in a quote:

```liquid
{% for product in quote.products %}
  <h3>{{ product.title }}</h3>
  <img src="{{ product.image }}" />

  {% for variant in product.variants %}
    <p>
      {{ variant.title }} ({{ variant.sku }})
      Qty: {{ variant.quantity }}
      Price: {{ variant.price_formatted }}
      Total: {{ variant.total_formatted }}
    </p>
  {% endfor %}
{% endfor %}
```

Each product has:

| Variable | Description |
| ---- |
| `product.title` | Product name |
| `product.image` | Product image URL |
| `product.shopify_product_id` | Shopify product ID |

Each variant has:

| Variable | Description |
| ---- |
| `variant.title` | Variant name (e.g. "Gray", "Large") |
| `variant.sku` | SKU code |
| `variant.image` | Variant image URL |
| `variant.quantity` | Quantity requested |
| `variant.price` | Unit price (plain number) |
| `variant.price_formatted` | Unit price with currency (e.g. "$25.00") |
| `variant.total` | Line total (plain number) |
| `variant.total_formatted` | Line total with currency (e.g. "$75.00") |

## Proposal Variables

These are available in proposal emails only.

| Variable | Example | Description |
| ---- |
| `proposal.id` | `Bz6VBgoZKO` | Unique proposal reference ID |
| `proposal.number` | `#00021` | Formatted proposal number |
| `proposal.url` | `https://yourstore.com/a/quote/proposal/Bz6VBgoZKO` | Link for the customer to view the proposal |
| `proposal.secret` | `48291` | Access code (if access codes are enabled) |
| `proposal.total` | `$1,250.00` | Proposal total with currency |
| `proposal.discount_total` | `$50.00` | Discount amount (empty if no discount) |
| `proposal.shipping_total` | `$15.00` | Shipping amount (empty if no shipping) |
| `proposal.created_at` | `10 Feb, 2026` | Date the proposal was created |

### Proposal Line Items

```liquid
{% for line in proposal.lines %}
  <p>
    {{ line.title }} ({{ line.sku }})
    Qty: {{ line.quantity }}
    Price: {{ line.price }}
    Total: {{ line.total }}
  </p>
{% endfor %}
```

Each line item has:

| Variable | Description |
| ---- |
| `line.title` | Item name (e.g. "Backpack - Gray") |
| `line.image` | Product image URL |
| `line.sku` | SKU code |
| `line.quantity` | Quantity |
| `line.price` | Unit price with currency |
| `line.total` | Line total with currency |
| `line.taxable` | Whether the item is taxable |
| `line.requires_shipping` | Whether the item requires shipping |

## Shop Variables

| Variable | Description |
| ---- |
| `shop.name` | Your store name |
| `shop.address1` | Street address |
| `shop.address2` | Additional address line |
| `shop.city` | City |
| `shop.zip` | Postal/ZIP code |
| `shop.country_name` | Country name |
| `shop.logo` | URL to your store logo |

## Other Variables

| Variable | Description |
| ---- |
| `message` | The custom message from your email settings |
| `url` | Proposal URL (proposal emails only, same as `proposal.url`) |
| `secret` | Access code (proposal emails only, same as `proposal.secret`) |
| `type` | Email type: `user:quote-confirmation`, `staff:quote-confirmation`, or `user:proposal` |

## Liquid Syntax

### Conditional content

```liquid
{% if quote.form.fields.company %}
  <p>Company: {{ quote.form.fields.company }}</p>
{% endif %}
```

### Showing content based on email type

```liquid
{% if type == 'user:quote-confirmation' %}
  <p>Thank you for your quote request!</p>
{% endif %}

{% if type == 'staff:quote-confirmation' %}
  <p>A new quote request has been received.</p>
{% endif %}
```

### Displaying a discount only when present

```liquid
{% if proposal.discount_total %}
  <p>Discount: {{ proposal.discount_total }}</p>
{% endif %}

{% if proposal.shipping_total %}
  <p>Shipping: {{ proposal.shipping_total }}</p>
{% endif %}

<p>Total: {{ proposal.total }}</p>
```

## Full Example

```liquid
<h3>Hi {{ quote.form.fields.first_name }},</h3>

<p>{{ message }}</p>

{% for fieldset in quote.form.fieldsets %}
  <h4>{{ fieldset.title }}</h4>
  <table>
    {% for field in fieldset.fields %}
      <tr>
        <td><strong>{{ field.name }}:</strong></td>
        <td>{{ field.value }}</td>
      </tr>
    {% endfor %}
  </table>
{% endfor %}

{% if quote.products %}
  <h4>Products</h4>
  {% for product in quote.products %}
    <h5>{{ product.title }}</h5>
    {% for variant in product.variants %}
      <p>{{ variant.title }} - {{ variant.sku }} - Qty: {{ variant.quantity }} - {{ variant.price_formatted }}</p>
    {% endfor %}
  {% endfor %}

  <p><strong>Total: {{ quote.total_formatted }}</strong></p>
{% endif %}
```