Skip to main content
The Email Templates service allows you to manage transactional email templates for user communications.

Overview

Email templates in SnackBase are used for:
  • User welcome emails
  • Password reset emails
  • Email verification emails
  • Invitation emails
  • Custom notifications

Installation

The Email Templates service is included in the @snackbase/sdk package:

Setup

Methods

list()

List all email templates with optional filtering.
Parameters:
  • template_type?: string - Filter by template type
  • locale?: string - Filter by locale (e.g., ‘en’, ‘es’)
  • enabled?: boolean - Filter by enabled status
  • status?: string - Filter by status
  • start_date?: string - Filter by start date
  • end_date?: string - Filter by end date
  • page?: number - Page number
  • limit?: number - Results per page

get()

Get a specific email template by ID.
Response:

update()

Update an email template.

render()

Render a template with variables (preview).

sendTest()

Send a test email to verify the template.

listLogs()

List email send logs.

Template Variables

Templates use Mustache syntax for variables:

Built-in Template Types

Complete Example

Error Handling

Next Steps