Nilovon Connect
SDK

Templates

Create reusable message templates with variable placeholders.

Templates let you define reusable message content with {{variable}} placeholders that get substituted at send time.

Create a template

const template = await connect.template.create({
  name: "welcome-email",
  channelType: "email",
  subject: "Welcome, {{name}}!",
  body: "<h1>Hey {{name}}</h1><p>Thanks for joining {{company}}.</p>",
  variables: ["name", "company"],
});

SMS templates work the same way:

await connect.template.create({
  name: "verification-code",
  channelType: "sms",
  body: "Your code is {{code}}. Expires in 10 minutes.",
  variables: ["code"],
});

List templates

const { items } = await connect.template.list({
  limit: 20,
  offset: 0,
});

Filter by channel:

const emailTemplates = await connect.template.list({
  channelType: "email",
  limit: 50,
  offset: 0,
});

Get a template

const template = await connect.template.get({ id: "tpl_..." });

Update a template

Updates are versioned — the previous version is preserved in the history:

await connect.template.update({
  id: "tpl_...",
  body: "<h1>Hey {{name}}</h1><p>Welcome to {{company}}. Here's what's next.</p>",
});

Delete a template

Templates are soft-deleted (set to inactive) so existing references keep working:

await connect.template.delete({ id: "tpl_..." });

On this page