Emails and OTP > SMTP & Resend Setup
Emails and OTP > SMTP & Resend SetupKroxt BaaS SDK v1.0.5

SMTP & Resend Setup

Manage email settings and logs inside the Kroxt Console with the following features:

Gmail/SMTP Config

Configure SMTP host (defaults to `smtp.gmail.com`), port (`465`), SSL/TLS verification toggle, and username/password.

Resend API Config

Simply insert your Resend API token (`re_...`) and configure custom fallback domain sender emails.

Send Transactional Email Code:
email.ts
1
2
3
4
5
6
await baas.communication.sendEmail({
  to: "user@example.com",
  subject: "Welcome to Kroxt",
  html: "<p>Hi {{name}}! We are glad to have you.</p>",
  variables: { name: "John Doe" },
});

TypeScript Type Integration

Import type definitions for custom email option payloads directly from the SDK:

types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
import type { EmailOptions } from "@kroxt/baas-sdk";

const options: EmailOptions = {
  to: "user@example.com",
  subject: "Welcome to Kroxt",
  html: "<p>Hi {{name}}!</p>",
  variables: { name: "John Doe" },
};

const result = await baas.communication.sendEmail(options);
if (result.success) {
  console.log(result.message);
}