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.template_type?: string- Filter by template typelocale?: string- Filter by locale (e.g., ‘en’, ‘es’)enabled?: boolean- Filter by enabled statusstatus?: string- Filter by statusstart_date?: string- Filter by start dateend_date?: string- Filter by end datepage?: number- Page numberlimit?: number- Results per page
get()
Get a specific email template by ID.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
- Admin Service - Configure email providers
- Error Handling - Handle errors gracefully