Features / Email

Email that just works.

Send transactional and notification emails through Resend, SMTP, or SendLayer. Templates with variable interpolation, encrypted credentials, and database-managed providers. All built in.

Overview

What it does

Nextly's email system handles transactional emails for authentication flows (welcome, password reset, email verification) and supports custom email sending through a provider-agnostic API.

You can configure an email provider in code viadefineConfig()or manage providers directly from the admin panel. Database-configured providers take priority over code config, so you can update credentials without redeploying. All credentials are encrypted at rest with AES-256-GCM.

The template engine supports{{placeholder}}variable interpolation with HTML escaping and dot notation for nested values. Three built-in templates cover common auth flows, and you can create custom templates for any purpose.

Three Providers

Resend (modern API), SMTP (any server via nodemailer), or SendLayer (REST API). Switch providers without changing your sending code.

Template System

Built-in templates for welcome, password reset, and email verification. Variable interpolation with {{placeholders}} and HTML layout composition.

Encrypted Credentials

Provider credentials are encrypted at rest with AES-256-GCM. The admin API returns masked values, and secrets never leave the server.

Database-Configured Providers

Create, test, and switch providers from the admin panel. Set a default provider and override per-email when needed. Code config works as fallback.

Providers

Pick your provider

All three providers share the same sending API, so you can switch without changing code.

Resend

Modern API, Resend SDK

{
 provider:"resend",
 apiKey:"re_xxxxx",
}

SMTP

Any SMTP server via nodemailer

{
 provider:"smtp",
 host:"smtp.gmail.com",
 port: 587,
 auth: {
  user:"...",
  pass:"...",
 },
}

SendLayer

REST API, native fetch

{
 provider:"sendlayer",
 apiKey:"xxxxx",
}
Code Example

Email provider setup

nextly.config.ts
import { defineConfig } from"@revnixhq/nextly/config";

export default defineConfig({
 email: {
  providerConfig: {
   provider:"resend",
   apiKey: process.env.RESEND_API_KEY!,
  },
  from:"My App <noreply@example.com>",
  baseUrl:"https://example.com",
  resetPasswordPath:"/auth/reset-password",
  verifyEmailPath:"/auth/verify-email",
 },
});

Provider priority: admin-configured provider code config error. You can manage providers from the admin panel and override the code config at any time.

Templates

Built-in templates with variables

Three built-in templates for common auth flows. Each supports variable interpolation with{{placeholders}}and is wrapped in a shared HTML layout.

Sending a templated email

Using the email service
await emailService.sendWithTemplate("password-reset","user@example.com", {
 resetLink:"https://example.com/reset?token=abc123",
 expiresIn:"1 hour",
 appName:"My App",
 userName:"John Doe",
});
welcome
Sent after registration
userName, appName
password-reset
Sent on reset request
resetLink, expiresIn, appName
email-verification
Sent for verification
verifyLink, expiresIn, appName

Variables are HTML-escaped by default to prevent XSS. Dot notation supported:{{user.name}}resolves nested values.

Comparison

Which provider to use

FeatureResendSMTPSendLayer
Setup1 API keyHost, port, auth1 API key
LibraryResend SDKnodemailerNative fetch
Best forProduction SaaSSelf-hosted / EnterpriseResend alternative

Start building with Nextly

Free, open source, and yours to own. No sign-up required.

>_npx create-nextly-app@latest