Skip to content

Configuration ​

Mail Resend reads the Email section when AddResendEmail receives an IConfiguration instance. An absent section binds successfully and fails validation instead, which is what reports the missing token rather than a binding error.

json
{
    "Email": {
        "ApiToken": "re_123456789",
        "BrandName": "Shogun",
        "FromEmail": "noreply@example.com",
        "FromName": "Shogun",
        "LogoUrl": "https://example.com/logo.png",
        "AppUrl": "https://example.com",
        "Links": {
            "Support": "https://example.com/support",
            "Dashboard": "https://example.com/dashboard"
        },
        "Template": {
            "CopyrightText": "Copyright {app_name}.",
            "FooterLinkText": "Open {app_name}",
            "IgnoreText": "Ignore this mail when you did not request it."
        }
    }
}

TIP

CopyrightText, FooterLinkText and IgnoreText each resolve {app_name} from BrandName and {app_url} from AppUrl, in the HTML body and the plain-text body alike.

EmailSettings

The Email section, bound by AddResendEmail and validated while the host starts, so a missing token or sender address fails startup instead of the first send. Inject IOptions<EmailSettings> to read it. Its computed From property pairs FromName with FromEmail as Resend expects, falling back to the bare address when no display name is configured.

Fields

ApiToken: string
Token every send is authenticated with. Required, and checked at startup.

FromEmail: string
Address messages are sent from. It must sit on a domain verified with Resend, which startup validation cannot check, so an unverified domain surfaces as a failed send.

FromName: string?
Display name paired with FromEmail. Left unset, messages send from the bare address.
Default: null

BrandName: string
Product name substituted for the {app_name} placeholder and rendered in the brand slot of the base template. Left empty it renders as nothing rather than falling back to FromName.
Default: ''

LogoUrl: string?
Logo shown in the base template header. Dropped from the rendered HTML unless it is an absolute http, https, or mailto URL.
Default: null

AppUrl: string?
URL behind the footer link and the {app_url} placeholder. Both are dropped under the same scheme rule as LogoUrl, leaving the footer link inert and the placeholder empty in the HTML and plain-text bodies alike.
Default: null

Links: IReadOnlyDictionary<string, string>
Named shared links as label-to-URL pairs. The package never reads them; they exist so an application can keep its link set alongside the rest of its mail configuration.
Default: {}

Template: EmailTemplateSettings
The nested Template section. When it is absent every value below keeps its own default rather than binding to an empty string.
Default: {}

EmailTemplateSettings

The nested Email:Template section, holding the footer and fallback wording every BaseMailTemplate shares, so copy appearing in each message is configured once instead of restated by every template class. {app_name} and {app_url} are substituted before CopyrightText and FooterLinkText are HTML encoded, so a brand name containing markup cannot escape into the document through either. IgnoreText is substituted as written, so markup reaching it through {app_name} renders.

Fields

CopyrightText: string
Copyright line closing the footer, resolved in both the HTML and the plain-text body.
Default: © {app_name}

FooterLinkText: string
Label of the footer link pointing at AppUrl. It still renders when that URL is unset or was rejected.
Default: {app_name}

IgnoreText: string
Line telling a recipient to disregard a message they did not expect. Alone among the footer values it is substituted into the HTML body as written rather than encoded, so it may carry markup such as <strong>, and the plain-text alternative reduces that markup to text with <br> becoming a line break. Set it only from values the application controls. Empty by default, which drops the line from the plain-text rendering and substitutes nothing for its HTML placeholder; whether that leaves a blank paragraph depends on the application's own base template.
Default: ''

All packages are released under the MIT License.