Templates

Create reusable message templates with merge tags for dynamic personalization.

Overview

Templates let you define message content once and reuse it across API calls and blast campaigns. Each template supports merge tags for dynamic content like recipient names, order IDs, etc.

Create a Template

  1. Go to Dashboard → Templates
  2. Click New Template
  3. Choose a channel (email, SMS, voice, WhatsApp)
  4. Write your content using merge tags
  5. Save and activate

Merge Tags

Use double curly braces to insert dynamic content:

TagDescription
{{name}}Recipient name
{{email}}Recipient email
{{business_name}}Your organization name
{{app_name}}Your app name
{{code}}OTP code (auto-generated)
{{custom_field}}Any custom value passed in tags object

AI Template Generation

Use the AI Generate feature to create professional templates from a simple prompt. Just describe what you need and AI generates the subject, HTML body, and plain text version.

Example prompt:"Create a welcome email for new users of a SaaS product with a CTA to complete their profile"

Using Templates in API

Reference a template by its ID when sending:

use-template.ts
await ys.send({
  channel: 'email',
  to: 'user@example.com',
  template_id: 'tmpl_welcome_v2',
  tags: {
    name: 'Alex',
    business_name: 'Acme Inc',
    dashboard_url: 'https://app.acme.com/dashboard',
  },
});