Campaigns

Spintax & Personalization

Cleanmails supports three layers of dynamic content in your campaign emails: spintax for variation, personalization tags for lead data, and AI tags for Gemini-powered content generation.

Spintax

Spintax creates random variations of your email so each recipient gets a slightly different version. This improves deliverability by avoiding duplicate content detection.

Syntax

text
{option1|option2|option3}

Examples

Subject Line
{Hey|Hi|Hello} {{FIRST_NAME}}, {quick question|wanted to reach out|thought of you}
Email Body
<p>{I noticed|I saw|I came across} your work at {{COMPANY}} and {wanted to reach out|thought we should connect}.</p>

<p>{Would you be open to|Are you interested in|Could we schedule} a {quick call|brief chat|15-min conversation} this week?</p>

<p>{Best regards|Cheers|Thanks},<br>{Alex|Jordan|Sam}</p>

Spintax can be nested and used in both subject lines and body content. Each send picks a random combination.

Personalization Tags

Insert lead-specific data using double curly braces:

TagResolves To
{{NAME}} or {{FIRST_NAME}}Lead's first name
{{LAST_NAME}}Lead's last name
{{COMPANY}}Lead's company
{{EMAIL}}Lead's email address
{{custom_field}}Any field from lead's ExtraData JSON

Fallback Values

If a field is empty, provide a fallback with the pipe character:

text
{{FIRST_NAME | "there"}}
{{COMPANY | "your company"}}

If the lead has no first name, it renders as "there" instead of blank.

AI Tags (Gemini Integration)

Generate dynamic, AI-personalized content for each lead using the Gemini API. AI tags are processed at send time with the lead's context.

Syntax

text
{{AI:prompt|fallback}}

Examples

AI-Personalized Email
<p>Hi {{FIRST_NAME}},</p>

<p>{{AI:Write a one-sentence compliment about their company based on what they do|I've been following your company's growth}}</p>

<p>{{AI:Generate a personalized reason why our email tool would help them|We help companies like yours scale outreach without monthly fees}}.</p>

<p>Would love to chat — are you free this week?</p>
How AI Tags Work

Each AI tag sends a prompt to Gemini with the lead's name, company, and your instruction. Results are cached for 24 hours to avoid duplicate API calls for similar leads.

Configuration

To use AI tags, configure your Gemini API key in Settings → AI Settings:

  • Gemini API Key — Get from Google AI Studio
  • Model — Default: gemini-2.5-flash (options: gemini-2.5-pro, gemini-2.5-flash-lite)

Safety Features

  • Rate limiting — Configurable requests/second (default: 10)
  • Circuit breaker — After 5 consecutive failures, AI tags fall back to the fallback text
  • Caching — Results cached for 24h (up to 1000 entries) to reduce API costs
  • Graceful degradation — If no API key is set, AI tags silently use the fallback value

Processing Order

When an email is sent, content is processed in this order:

  1. Personalization{{NAME}}, {{COMPANY}} replaced with lead data
  2. Spintax{option1|option2} randomly resolved
  3. AI Tags{{AI:prompt|fallback}} sent to Gemini with lead context
  4. Link wrapping — URLs wrapped for click tracking (if enabled)
  5. Unsubscribe footer — Added automatically
  6. Open pixel — Inserted (if tracking enabled)