Documentation base URLs use placeholder https://{your-tenant}.sso.id. Log in to show your tenant or custom domain.
Log in for Your Tenant URL
Chapter 8D — White-Label Transactional Email Delivery

Custom SMTP Relay & Email Template Studio

Ensure every invitation, email verification link, password reset, MFA OTP code, and suspicious-login security alert arrives from your own SPF/DKIM/DMARC-verified domain (e.g., [email protected]) via /smtp and /settings.

Deliverability Story: Passing Strict Corporate Email Firewalls

Why Enterprise IT Gateways Block Generic Shared Senders — And How Custom SMTP Fixes It

When CloudPulse invited employees at GlobalBank (@globalbank.com), the bank's Proofpoint/Mimecast firewall flagged external emails that didn't align with CloudPulse's corporate DMARC policy.

By connecting their Amazon SES / SendGrid SMTP credentials in /smtp (and /settings → Email & SMTP), verifying delivery with Send Test Email (POST /api/smtp/test), and customizing the HTML templates (PUT /api/settings/tenant/email-templates), CloudPulse achieved a 99.8% inbox placement rate with 100% brand consistency.

1. Configuring Your Custom SMTP Relay

Configure your SMTP relay in /smtp or inside /settings → Email / SMTP using any standard SMTP provider (Amazon SES, SendGrid, Postmark, Mailgun, Microsoft 365, Google Workspace):

Flow Diagram Transactional Email Delivery & Testing Pipeline
flowchart LR EV["Identity Event (Invite / OTP / Reset / Alert)"] --> TPL["Render Branded Multilingual HTML Template"] TPL --> SMTP["Outbound SMTP Relay (SES / SendGrid / M365)"] SMTP --> TLS{"STARTTLS / SSL Handshake"} TLS -->|"Success"| INBOX["Recipient Inbox (DKIM / SPF Aligned)"] TLS -->|"Failure"| LOG["Logged to /audit-logs & Error Alert"]
Triggered security events render branded HTML templates and dispatch through your configured SMTP relay, verified with live test emails.
https://cloudpulse.us.beta.sso.id/smtp Click to zoom
Dedicated SMTP Configuration console at /smtp for managing outbound relay host, port, and sender credentials.
Dedicated SMTP Configuration console at /smtp for managing outbound relay host, port, and sender credentials.
https://cloudpulse.us.beta.sso.id/settings Click to zoom
Tenant Settings — Email Gateway (SMTP) configuration tab with live test email dispatch.
Tenant Settings — Email Gateway (SMTP) configuration tab with live test email dispatch.
Field Example Value Description
host email-smtp.us-east-1.amazonaws.com or smtp.sendgrid.net Hostname of your outbound SMTP relay server.
port & enableSsl 587 (STARTTLS) or 465 (Implicit TLS) Enforces encrypted TLS transmission between Core.SSO.Id and your mail relay.
username & password apikey / SMTP IAM Credentials Encrypted at rest in SSO.ID's credential store.
fromEmail & fromName [email protected] / CloudPulse Security Sender identity displayed in the recipient's inbox.

2. Customizing Transactional HTML Email Templates

In /settings → Email Templates (GET / PUT /api/settings/tenant/email-templates), you can customize the Subject Line and HTML Body for every identity lifecycle event using dynamic Mustache/Handlebars variables ({{UserName}}, {{ActionUrl}}, {{OtpCode}}, {{TenantName}}, {{IpAddress}}):

  • Welcome & Registration Verification Email ({{ActionUrl}}, {{UserName}})
  • User & Tenant Member Invitation Email ({{InviteUrl}}, {{InviterName}}, {{TenantName}})
  • Forgot Password / Password Reset Email ({{ResetUrl}}, {{ExpiryMinutes}})
  • Multi-Factor Authentication (MFA) Email OTP ({{OtpCode}}, {{ExpiryMinutes}})
  • Suspicious Login / New Device Security Alert ({{IpAddress}}, {{DeviceBrowser}}, {{Timestamp}})

3. SMTP & Email Templates REST API Reference & AI Prompt

Method Endpoint Description
GET / POST / PUT https://{your-tenant}.sso.id/api/smtp Retrieves, creates, or updates custom SMTP configurations (DELETE /api/smtp/{id} removes).
POST https://{your-tenant}.sso.id/api/smtp/test Dispatches a live test email to verify SMTP credentials and TLS handshake (also available at POST /api/settings/tenant/smtp).
GET / PUT https://{your-tenant}.sso.id/api/settings/tenant/email-templates Retrieves or saves custom HTML email templates (DELETE resets a template to system default).

Custom SMTP Relay & Transactional Email Templates API Specifications

Below is the complete parameter-level specification for every endpoint in this module. Tenant context is automatically resolved from the signed Bearer JWT token claims or the tenant domain URL (no custom tenant header is required).

PUT https://{your-tenant}.sso.id/api/settings/tenant/smtp
Bearer JWT

Configures or updates the custom SMTP relay server (Amazon SES, SendGrid, Postmark, Mailgun, Microsoft 365, or private postfix relay) for transactional identity emails. Use GET /api/settings/tenant/smtp (or GET /api/smtp) to retrieve current settings.

Request Parameters
Parameter Type Required Description & Constraints
Authorization Header string Required Bearer JWT access token (Bearer eyJhbG...). Tenant context is resolved automatically from the token claims or request domain URL.
senderEmail Body string Required Verified 'From' email address (e.g., [email protected]).
senderName Body string Required Friendly sender display name (e.g., CloudPulse Security).
hostUrl Body string Required SMTP server hostname (e.g., email-smtp.us-east-1.amazonaws.com, smtp.sendgrid.net).
port Body string Required SMTP port (typically 587 for STARTTLS or 465 for implicit TLS).
userName Body string Required SMTP authentication username or API key user.
password Body string Required SMTP authentication password or API secret (encrypted at rest).
protocol Body string Optional Encryption protocol: STARTTLS, SSL/TLS, or NONE.
isDefault Body boolean Optional Set to true to route all tenant emails through this SMTP provider.
Response Fields & Schema
Field Type Description
connectionId integer SMTP configuration ID.
senderEmail string Configured sender email.
hostUrl string Configured SMTP host.
port string Configured SMTP port.
isDefault boolean Active default relay status.
Sample Request
curl -X PUT "https://{your-tenant}.sso.id/api/settings/tenant/smtp" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "senderEmail": "[email protected]",
    "senderName": "CloudPulse Identity",
    "hostUrl": "email-smtp.us-east-1.amazonaws.com",
    "port": "587",
    "userName": "AKIAIOSFODNN7EXAMPLE",
    "password": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    "protocol": "STARTTLS",
    "isDefault": true
  }'
Expected Response 200 OK
{
  "connectionId": 7,
  "senderEmail": "[email protected]",
  "senderName": "CloudPulse Identity",
  "hostUrl": "email-smtp.us-east-1.amazonaws.com",
  "port": "587",
  "protocol": "STARTTLS",
  "isDefault": true
}
POST https://{your-tenant}.sso.id/api/settings/tenant/smtp/test
Bearer JWT

Executes a live SMTP handshake, authenticates against the configured relay, and dispatches a diagnostic test message to verify deliverability and TLS settings.

Request Parameters
Parameter Type Required Description & Constraints
Authorization Header string Required Bearer JWT access token (Bearer eyJhbG...). Tenant context is resolved automatically from the token claims or request domain URL.
recipientEmail Body string Required Destination email address to receive the test message.
hostUrl Body string Optional Optional SMTP host override for pre-save testing.
port Body string Optional Optional port override.
userName Body string Optional Optional username override.
password Body string Optional Optional password override.
Response Fields & Schema
Field Type Description
success boolean True if the SMTP handshake and message delivery succeeded.
latencyMs integer Round-trip SMTP delivery time in milliseconds.
serverResponse string 250 OK diagnostic response from the remote mail server.
Sample Request
curl -X POST "https://{your-tenant}.sso.id/api/settings/tenant/smtp/test" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "recipientEmail": "[email protected]"
  }'
Expected Response 200 OK
{
  "success": true,
  "latencyMs": 312,
  "serverResponse": "250 2.0.0 OK <[email protected]>"
}
PUT https://{your-tenant}.sso.id/api/settings/tenant/email-templates/{emailType}
Bearer JWT

Saves a customized HTML email template and subject line for a specific transactional email type. Use GET /api/settings/tenant/email-templates to list all templates, POST /api/settings/tenant/email-templates/{emailType}/test to send a rendered test email, and DELETE /api/settings/tenant/email-templates/{emailType}/reset to revert to the system default.

Request Parameters
Parameter Type Required Description & Constraints
Authorization Header string Required Bearer JWT access token (Bearer eyJhbG...). Tenant context is resolved automatically from the token claims or request domain URL.
emailType Path string Required Template identifier (e.g., Welcome, UserInvite, PasswordReset, EmailVerification, MfaOtp, SecurityAlert).
emailSubject Body string Required Email subject line supporting dynamic merge tags like {{TenantName}} and {{UserName}}.
emailTemplateBody Body string (HTML) Required Full inline-CSS HTML email body supporting merge tags: {{UserName}}, {{ActionUrl}}, {{OtpCode}}, {{TenantName}}, {{SupportEmail}}.
Response Fields & Schema
Field Type Description
emailType string Updated template key.
emailSubject string Saved subject line.
isCustomized boolean True indicating custom template override is active.
Sample Request
curl -X PUT "https://{your-tenant}.sso.id/api/settings/tenant/email-templates/MfaOtp" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "emailSubject": "[{{TenantName}}] Your Verification Code: {{OtpCode}}",
    "emailTemplateBody": "<div style=\"font-family:Inter,sans-serif;padding:24px;\"><h2>Hello {{UserName}},</h2><p>Your one-time security verification code is: <strong style=\"font-size:24px;color:#ff6b35;\">{{OtpCode}}</strong></p></div>"
  }'
Expected Response 200 OK
{
  "emailType": "MfaOtp",
  "emailSubject": "[{{TenantName}}] Your Verification Code: {{OtpCode}}",
  "isCustomized": true
}
AI Agent Prompt Generate Responsive Dark-Mode HTML Email Templates & Sync via /api/settings/tenant/email-templates
You are an email design and IAM automation engineer. Generate a set of responsive, inline-CSS HTML email templates for **SSO.ID v2** (Welcome Verification, User Invitation, Password Reset, MFA OTP Code, and Security Alert) preserving placeholders `{{UserName}}`, `{{ActionUrl}}`, `{{OtpCode}}`, and `{{TenantName}}`, and write a Node.js/TypeScript script that deploys them to our tenant via `PUT https://{your-tenant}.sso.id/api/settings/tenant/email-templates` and tests delivery via `POST https://{your-tenant}.sso.id/api/smtp/test`.