Email Templates

Frontend Usage Guide

Frontend Usage Guide

Email Template Variables

A streamlined process where frontend engineers embed template variables directly into email HTML, ensuring HTML integrity and faster turnaround with clear ownership.

Frontend

Template Ownership

{{var}}

Variable Syntax

Faster

Turnaround

Reduced

Error Rate

01

Overview

To reduce errors and maintain HTML integrity, frontend engineers are now responsible for embedding template variables directly into email HTML. Backend will no longer modify HTML content—they will only load templates as-is.

Before (Old Process)

  • FE delivers static HTML with placeholder text
  • Backend modifies HTML to inject variables
  • Risk of breaking HTML structure
  • Back-and-forth for corrections

After (New Process)

  • FE embeds variables directly in HTML
  • Backend loads templates without modification
  • HTML integrity preserved
  • Clear ownership and faster turnaround
Frontend
HTML + Variables
Backend (Load Only)
Email Sent
02

Workflow Decision

Your workflow depends on whether a variable specification already exists for the email template.

Variables Already Exist - Steps

1

Backend shares the .go variable spec file

2

Review the spec to identify available variables

3

Embed variables in your HTML using {{variableName}}

4

Submit the complete template to backend

03

Case 1: Variables Already Exist

When the backend team has already defined the variable specification for an email template, follow this process:

1

Backend shares the variable spec

You will receive a .go file (e.g., new-inflow-mail-variables.go) containing the available variables and their types.

2

Review the spec

new-inflow-mail-variables.go
NewInflowEmailTemplateVariables {
 amount number // Amount for the inflow
 currency string // Currency of the inflow
 inflowFrom string // Who the inflow's from
 inflowRef string // Reference for the inflow
 transactionId string // Unique transaction id
 ...variables // Inherited from @root/variables.go
}

Note: ...variables means you also have access to root variables like year, baseUrl, and nuvionLogo.

3

Embed variables in your HTML

Use the {{variableName}} syntax:

❌ Before (what we want to avoid)
<p>Hello Damian, your account is now active</p>
<p>You received NGN 50,000 from John Doe</p>
✓ After (what FE should deliver)
<p>Hello {{fullname}}, your account is now active</p>
<p>You received {{currency}} {{amount}} from <i>{{inflowFrom}}</i></p>
4

Submit the complete template

Hand off the HTML with all variables already in place. Backend will load it directly without modifications.

04

Case 2: Variables Don't Exist

When you're working on a new email design and no variable spec exists yet, follow this process:

1

Create Design

Build the HTML template with placeholder text as usual

2

Request Review

Share design with backend team for variable identification

3

Receive Spec

Backend provides the .go variable definition file

4

Apply Case 1

Follow Case 1 process to embed variables

1

Create your email design

Build the HTML template with placeholder text as usual. Focus on the visual design and structure without worrying about the variables at this stage.

2

Request a variable spec review

Share the design with the backend team and ask them to:

  • Identify which parts of the content need to be dynamic
  • Create the corresponding variable specification (.go file)
3

Receive the new spec

Backend will provide the variable definition file. This file will list all available variables with their types and descriptions.

4

Proceed with Case 1

Once you have the spec, follow the Case 1 process to embed the variables into your HTML. This ensures consistency across all email templates.

05

Interactive Demo

See how template variables get replaced with actual values when the email is rendered.

1
Template
2
Variables
3
Result

Variable Values

fullnameSarah Chen
currencyUSD
amount1,250.00
inflowFromAcme Corp

Raw HTML with variable placeholders

Hello {{fullname}}, your account is now active

You received {{currency}} {{amount}} from {{inflowFrom}}

06

Syntax Reference

SyntaxDescriptionExampleCopy
{{variableName}}Insert a variable value{{fullname}} → "Damian"
{{baseUrl}}Root variable for app URLhref="{{baseUrl}}/account-activation"
{{nuvionLogo}}Root variable for logo URLsrc="{{nuvionLogo}}"
07

Root Variables

These are inherited from @root/variables.go and available in all templates. Access them via the ...variables spread.

year

string

Current year

Example: 2025
baseUrl

string

Base URL of the frontend app

Example: https://app.nuvion.com
nuvionLogo

string

Hosted URL to the official Nuvion Logo

Example: https://cdn.nuvion.com/logo.png
Example Usage in HTML
<footer>
  <img src="{{nuvionLogo}}" alt="Nuvion Logo" />
  <a href="{{baseUrl}}/dashboard">Go to Dashboard</a>
  <p>© {{year}} Nuvion. All rights reserved.</p>
</footer>
08

Why This Matters

Reduces Errors

Backend team members unfamiliar with HTML won't accidentally break markup. HTML structure stays intact throughout the process.

Faster Turnaround

No back-and-forth for HTML corrections. Templates go straight from frontend to production without modification delays.

Clear Ownership

Frontend owns HTML structure and styling. Backend owns data injection and variable management. Clean separation of concerns.

The Bottom Line

By having frontend engineers embed template variables directly, we create a more reliable, faster, and cleaner workflow. The HTML never needs to be touched by backend, reducing the risk of broken emails and ensuring templates look exactly as designed.