Skip to main content

Template Variables

Use double curly braces to insert lead data into your email templates. Variables are replaced with actual values when the email is sent.
Hi {{first_name}},

I noticed {{company}} is growing fast. Would love to chat about how we can help.
Result for John at Acme Inc:
Hi John,

I noticed Acme Inc is growing fast. Would love to chat about how we can help.

Available Variables

These standard variables map directly to lead fields:
VariableDescriptionExample Value
{{first_name}}Lead’s first nameJohn
{{last_name}}Lead’s last nameDoe
{{full_name}}First + last name combinedJohn Doe
{{email}}Lead’s email address[email protected]
{{company}}Company nameAcme Inc.
{{title}}Job titleMarketing Manager
{{phone}}Phone number+1 555-1234
{{linkedin}}LinkedIn profile URLhttps://linkedin.com/in/johndoe
{{website}}Website URLhttps://acme.com
You can also use camelCase variants: {{firstName}}, {{lastName}}, {{fullName}}, {{jobTitle}}.

Custom Field Variables

Any custom fields stored on a lead can also be used as variables:
I see you're in the {{industry}} space in {{location}}.
Custom fields are set via the customFields object when creating or updating a lead:
{
  "email": "[email protected]",
  "customFields": {
    "industry": "Technology",
    "location": "San Francisco"
  }
}

Fallback Values

If a variable has no value for a particular lead, you can provide a fallback using the pipe | syntax:
Hi {{first_name|there}},

I saw that {{company|your company}} is doing great work.
If first_name is missing, the email will read “Hi there,” instead of “Hi ,” with an awkward blank.

Spin Syntax

Spin syntax creates random variations of your email content. This helps improve deliverability by making each email unique, which avoids spam filter detection for bulk sends.

How It Works

Wrap alternative phrases in single curly braces, separated by pipes:
{Hi|Hello|Hey} {{first_name}},

{I noticed|I saw|I came across} {{company}} and {wanted to reach out|thought I'd connect}.
Each time an email is sent, one option is randomly selected from each spin block. This single template produces 12 unique variations (3 x 2 x 2).

Examples

Input:
{Hi|Hello|Hey} {{first_name}},

{I hope this finds you well.|Hope you're having a great week.}

{I noticed|I saw|I came across} that {{company}} is {growing quickly|expanding|scaling up}.
{I'd love to|Would love to|I'd be happy to} chat about how we can help.

{Best|Cheers|Thanks},
{Your Name}
Possible output 1:
Hello John,

Hope you're having a great week.

I came across that Acme Inc is scaling up.
I'd be happy to chat about how we can help.

Cheers,
Your Name
Possible output 2:
Hi John,

I hope this finds you well.

I noticed that Acme Inc is growing quickly.
Would love to chat about how we can help.

Best,
Your Name

Syntax Rules

Spin syntax

Single braces with pipes: {option1|option2|option3}Used for email text variation.

Variables

Double braces: {{variable_name}}Used for lead personalization.
  • Spin blocks require at least two options separated by |
  • Spin blocks cannot be nested{Hello {there|friend}} is not supported
  • Empty options are not allowed — {Hi||Hey} will cause a validation error
  • Variables and spin syntax can be combined freely in the same template

Using in the API

Both subject and body fields in templates support variables and spin syntax:
curl -X POST "https://api.foxreach.io/api/v1/templates" \
  -H "X-API-Key: otr_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cold Outreach v1",
    "subject": "{Quick question|Thought of {{company}}|Idea for {{first_name}}}",
    "body": "{Hi|Hey} {{first_name|there}},\n\n{I noticed|I saw} {{company}} is {growing|scaling}. {Would love to|I'\''d like to} discuss how we can help.\n\n{Best|Cheers},\nYour Name"
  }'
Spin syntax in the subject line is powerful but use it carefully — make sure every variation makes grammatical sense.