<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How can I customize email templates per tenant without duplicating templates?]]></title><description><![CDATA[<p dir="auto">I need to send emails with different branding (logo, colors, company name, support email) for each tenant in my multi-tenant FusionAuth setup. However, I don't want to maintain separate email templates for each tenant. Is there a way to use a single email template that dynamically pulls tenant-specific branding information?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/3274/how-can-i-customize-email-templates-per-tenant-without-duplicating-templates</link><generator>RSS for Node</generator><lastBuildDate>Sat, 24 Oct 2026 09:56:18 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/3274.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Oct 2026 21:35:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How can I customize email templates per tenant without duplicating templates? on Sat, 24 Oct 2026 02:23:28 GMT]]></title><description><![CDATA[<p dir="auto">Yes, you can use FreeMarker logic in FusionAuth email templates to dynamically customize content per tenant without duplicating templates.</p>
<h2>Solution</h2>
<p dir="auto">Store tenant-specific branding data in the <code>tenant.data</code> field (custom JSON). For example:</p>
<pre><code class="language-json">{
  "branding": {
    "logoUrl": "https://cdn.example.com/acme/logo.png",
    "primaryColor": "#0057b8",
    "buttonTextColor": "#ffffff",
    "subjectPrefix": "[Acme]",
    "supportEmail": "help@acme.com",
    "companyName": "Acme"
  }
}
</code></pre>
<p dir="auto">Then reference this data in your email templates using FreeMarker syntax. Here's an example for email verification:</p>
<pre><code class="language-html">[#assign b = (tenant.data.branding)!{}]
[#assign color = b.primaryColor!"#333333"]

&lt;div style="font-family: Arial, sans-serif;"&gt;
  &lt;img src="${b.logoUrl!'https://cdn.example.com/default-logo.png'}" alt="${b.companyName!tenant.name}" height="40"&gt;

  &lt;p&gt;Hi ${user.firstName!'there'},&lt;/p&gt;

  [#if verificationOneTimeCode??]
    &lt;p&gt;Your verification code:&lt;/p&gt;
    &lt;p&gt;&lt;strong&gt;${verificationOneTimeCode}&lt;/strong&gt;&lt;/p&gt;
  [#else]
    [#assign url = "${baseUrl}/email/verify/${verificationId}?client_id=${(application.oauthConfiguration.clientId)!''}&amp;tenantId=${tenant.id}"]
    &lt;a href="${url?html}"
       style="background:${color}; color:${b.buttonTextColor!'#ffffff'}; padding:12px 24px; text-decoration:none; border-radius:4px;"&gt;
      Verify email
    &lt;/a&gt;
  [/#if]
&lt;/div&gt;
</code></pre>
<h2>How it works</h2>
<ul>
<li><code>[#assign b = (tenant.data.branding)!{}]</code> safely extracts the branding object or defaults to an empty object</li>
<li><code>${b.logoUrl!'default-value'}</code> provides fallback values if a property is missing</li>
<li>The same template works across all tenants, pulling each tenant's specific branding from <code>tenant.data</code></li>
</ul>
<p dir="auto">This approach works for all FusionAuth email templates (email verification, forgot password, email MFA). The complexity and depth of customization you can achieve depends on your specific needs, but this pattern handles most common branding requirements.</p>
<p dir="auto">There's no form for editing tenant data, but you can do so using one of <a href="https://fusionauth.io/docs/sdks/" rel="nofollow ugc">the client libraries</a> and your own custom form.</p>
]]></description><link>https://fusionauth.io/community/forum/post/8887</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/8887</guid><dc:creator><![CDATA[FASupportBot]]></dc:creator><pubDate>Sat, 24 Oct 2026 02:23:28 GMT</pubDate></item></channel></rss>