SqlOS

AuthServer

Email Branding

Set the built-in logo, colors, and application name used by SqlOS auth emails.

5 sections

Email Branding controls the built-in templates for Email OTP and organization invitations.

Use it when you want a client-ready branded email without owning every HTML template. Use BuildMessage delegates when you need a fully custom layout, copy, localization strategy, or provider-specific payload.

What is configurable#

SettingUsed for
Application nameOTP subject/body and fallback invite branding
LogoHeader image in built-in email templates
Primary colorCode highlight and invitation button
Accent colorHeadings and primary text
Background colorEmail body background

Logo values are stored as data URLs, for example data:image/png;base64,....

Dashboard#

Open:

TEXT
/sqlos/admin/auth/settings

Use Auth Page > Email Branding to update the application name, colors, and logo used by built-in auth emails.

AuthPage branding and email branding are separate

AuthPage branding controls the browser UI. Email Branding controls email templates. Email Branding falls back to AuthPage logo/colors when email-specific values are empty.

Seed from startup#

Seeded email branding is useful for local development, preview apps, and production environments that should be controlled from code or configuration.

CSHARP
builder.AddSqlOS<AppDbContext>(options =>
{
    options.AuthServer.SeedAuthEmails(email =>
    {
        email.ApplicationName = "Acme";
        email.LogoBase64 = builder.Configuration["SqlOS:Email:LogoBase64"];
        email.PrimaryColor = "#16a34a";
        email.AccentColor = "#111827";
        email.BackgroundColor = "#f0fdf4";
    });
});

The bootstrapper applies seeded values on startup. If you want admins to control branding in the dashboard, do not seed these values after the initial setup period.

Advanced templates#

Email OTP:

CSHARP
options.AuthServer.ConfigureEmailOtp(email =>
{
    email.BuildMessage = ctx => new SqlOSAuthEmailMessage(
        ctx.Email,
        $"Your {ctx.ApplicationName} code",
        RenderOtpHtml(ctx),
        RenderOtpText(ctx));
});

Invitations:

CSHARP
options.AuthServer.ConfigureInvitations(invites =>
{
    invites.BuildMessage = ctx => new SqlOSAuthEmailMessage(
        ctx.Email,
        $"Join {ctx.OrganizationName}",
        RenderInviteHtml(ctx),
        RenderInviteText(ctx));
});

Both contexts include resolved branding so custom templates can reuse the dashboard/seeded values.

Runtime behavior#

SqlOS resolves branding in this order:

  1. Email-specific settings from the dashboard or SeedAuthEmails(...).
  2. AuthPage logo/colors for visual fallback.
  3. EmailOtp.ApplicationName.
  4. SqlOS.

Invitation emails can override the application name with ConfigureInvitations(invites => invites.ApplicationName = "...").