Relay SMS Platform
Available Templates

Authentication Templates

Four production-ready templates for authentication and security use cases.

Starter Tier: Use sendTypedTemplate

If you're on Starter tier, use the SDK's sendTypedTemplate() method or the /v1/messages/send-template API endpoint. These examples show template rendering only - see Using Templates for complete sending examples.

Allowed on Starter Tier

All Authentication templates are approved for Starter tier shared numbers (2FA campaign type).

OTP Verification

Send one-time password codes for 2FA.

TypeScriptCode
import { getTemplate, renderTemplate } from '@relay-works/templates'; const template = getTemplate('otp-verify'); const result = renderTemplate(template, { code: '482916', company: 'Acme' }); // "482916 is your Acme verification code."

Variables:

  • code (string) - 6-digit verification code
  • company (string) - Your company name

Best for: Two-factor authentication, login verification, account verification


Password Reset

Send password reset links with expiration time.

TypeScriptCode
import { getTemplate, renderTemplate } from '@relay-works/templates'; const template = getTemplate('password-reset'); const result = renderTemplate(template, { company: 'Acme', url: 'https://relay.link/rst-x7k', minutes: 15 }); // "Reset your Acme password: https://relay.link/rst-x7k. Link expires in 15 min."

Variables:

  • company (string) - Your company name
  • url (string) - Password reset URL (use short links)
  • minutes (number) - Expiration time in minutes

Best for: Password recovery, account access restoration


New Login Alert

Notify users of new login from unrecognized device.

TypeScriptCode
import { getTemplate, renderTemplate } from '@relay-works/templates'; const template = getTemplate('new-login-alert'); const result = renderTemplate(template, { company: 'Acme', location: 'New York, NY', device: 'iPhone 15', url: 'https://relay.link/secure' }); // "New login to your Acme account from iPhone 15 in New York, NY. Not you? Secure account: https://relay.link/secure"

Variables:

  • company (string) - Your company name
  • location (string) - City and state/country
  • device (string) - Device name
  • url (string) - Security action URL

Best for: Security notifications, suspicious activity alerts


Account Security Alert

Generic security notification for account changes.

TypeScriptCode
import { getTemplate, renderTemplate } from '@relay-works/templates'; const template = getTemplate('account-security-alert'); const result = renderTemplate(template, { company: 'Acme', action: 'password changed', url: 'https://relay.link/help' }); // "Your Acme account security: password changed. Didn't do this? https://relay.link/help"

Variables:

  • company (string) - Your company name
  • action (string) - What security action occurred
  • url (string) - Help/support URL

Best for: Password changes, email updates, 2FA settings changes


Next Steps:

Last modified on