Skip to content

Email Template Variables

Reference documentation for all available template variables, organized by template type. Required variables are marked with Required.


These variables are automatically injected when brokerage_id is provided to the render function:

VariableTypeDescription
brokerage_namestringBrokerage display name from database
brokerage_logo_urlurlBrokerage logo URL, or HomeStar fallback

Sent when a broker registers to verify their email address.

VariableRequiredTypeDescription
brokerage_nameYesstringName of the registering brokerage
broker_nameYesstringName of the person registering
verification_urlYesurlFull URL for email verification

Example usage:

render_template(
"verification",
brokerage_name="Coastal Properties",
broker_name="Dana Shore",
verification_url="https://homestar.ink/verify?token=abc123"
)

Passwordless login link for favorites sync functionality.

VariableRequiredTypeDescription
verify_urlYesurlMagic link URL for authentication
brokerage_nameYesstringBrokerage name for branding
expiry_minutesNointegerLink expiration time (default: 15)

Example usage:

render_template(
"magic_link",
verify_url="https://app.homestar.ink/auth/magic?token=xyz",
brokerage_name="Mountain View Realty",
expiry_minutes=30
)

Notifies agents when a lead is assigned or reassigned to them.

VariableRequiredTypeDescription
agent_nameYesstringReceiving agent’s display name
lead_nameYesstringLead’s full name
lead_emailYesstringLead’s email address
lead_phoneYesstringLead’s phone (or italic “Not provided”)
subject_typeYesstringType of inquiry (buying, selling, etc.)
message_previewYesstringFirst 200 chars of lead’s message
dashboard_urlYesurlLink to lead in admin dashboard
header_titleYesstring”New Lead Assigned” or “Lead Reassigned”
actionYesstring”assigned” or “reassigned from {name}“
footer_messageYesstringContext about the assignment

Example usage:

render_template(
"lead_assignment",
agent_name="Sarah Chen",
lead_name="John Smith",
lead_email="john@example.com",
lead_phone="(208) 555-1234",
subject_type="Buying",
message_preview="I'm looking for a 3-bed home...",
dashboard_url="https://app.homestar.ink/admin/leads/42",
header_title="New Lead Assigned",
action="assigned",
footer_message="This lead was automatically routed to you."
)

Alerts agents about new lead inquiries from the website.

VariableRequiredTypeDescription
agent_nameYesstringReceiving agent’s name
lead_nameYesstringLead’s full name
lead_emailYesstringLead’s email address
lead_phoneYesstringLead’s phone (or italic “Not provided”)
subject_typeYesstringType of inquiry (buying, selling, renting, etc.)
messageYesstringLead’s full message
dashboard_urlYesurlLink to lead in admin dashboard
property_sectionNohtmlOptional MJML section with property details
brokerage_nameYesstringBrokerage name (auto-injected)
brokerage_logo_urlYesurlBrokerage logo (auto-injected)

Example usage:

render_lead_notification_email(
agent_name="Mike Rodriguez",
lead_name="Emma Wilson",
lead_email="emma@example.com",
lead_phone="(208) 555-9876",
subject_type="buying",
message="I'm interested in scheduling a viewing...",
dashboard_url="https://app.homestar.ink/admin/leads/55",
property_address="456 Pine Avenue, Boise, ID",
brokerage_id=3
)

Confirms a scheduled property tour with the client.

VariableRequiredTypeDescription
client_nameYesstringClient’s display name
property_addressYesstringFull address of tour property
tour_dateYesstringFormatted date (e.g., “Saturday, January 25”)
tour_timeYesstringFormatted time (e.g., “2:00 PM”)
agent_nameYesstringConducting agent’s name
agent_phone_displayNohtmlAgent phone with tel: link formatting
brokerage_nameYesstringBrokerage name (auto-injected)
brokerage_logo_urlYesurlBrokerage logo (auto-injected)

Example usage:

render_tour_confirmation_email(
client_name="Robert Taylor",
property_address="789 Oak Street, Eagle, ID 83616",
tour_date="Saturday, January 25",
tour_time="2:00 PM",
agent_name="Lisa Park",
agent_phone="(208) 555-4321",
brokerage_id=5
)

Delivers downloadable market reports to prospects.

VariableRequiredTypeDescription
greetingNostringPersonalized greeting (default: “Hi there!”)
area_displayYesstringMarket area name (e.g., “Boise, Idaho”)
download_urlYesurlURL to download the PDF report
unsubscribe_urlYesurlURL to unsubscribe from reports
brokerage_nameYesstringBrokerage name (auto-injected)
brokerage_logo_urlYesurlBrokerage logo (auto-injected)

Example usage:

render_market_report_email(
area_display="Boise, Idaho",
download_url="https://cdn.homestar.ink/reports/boise-jan-2025.pdf",
brokerage_name="HomeStar Realty",
unsubscribe_url="https://homestar.ink/unsubscribe?token=abc",
name="Jennifer", # Optional - creates "Hi Jennifer!"
brokerage_id=1
)

The visual editor groups variables by semantic category based on naming prefixes:

PrefixCategoryExamples
client_, recipient_, user_Recipientclient_name
property_, listing_Propertyproperty_address
agent_Agentagent_name, agent_phone_display
brokerage_, broker_Brokeragebrokerage_name, brokerage_logo_url
tour_Tourtour_date, tour_time
lead_Leadlead_name, lead_email
market_, report_Marketarea_display

Variables not matching these prefixes appear in the Other category.


In the editor’s Variables panel:

Badge ColorMeaning
AmberRequired variable - must be provided
GrayOptional variable - may be empty

Some variables accept HTML content:

VariableHTML Usage
agent_phone_displayLine break and tel: link for phone
property_sectionFull MJML section for property details
lead_phoneItalic “Not provided” fallback

Some templates have sensible defaults:

TemplateVariableDefault
magic_linkexpiry_minutes15
market_reportgreeting"Hi there!"
lead_notificationproperty_section"" (empty)

The backend provides type-safe convenience functions for each template:

# Instead of raw render_template()
from idx_api.services.email_templates import (
render_verification_email,
render_magic_link_email,
render_lead_notification_email,
render_lead_assignment_email,
render_tour_confirmation_email,
render_market_report_email,
)

These functions:

  • Enforce required parameters at the function signature level
  • Handle variable formatting (phone numbers, HTML sections)
  • Accept brokerage_id for auto-injection
  • Return compiled HTML ready for sending