Documentation

Communication templates

Keep the emails and SMS your project sends as files in your repository, and push them to each environment.

The emails and SMS your project sends, such as verification codes and password resets, can live in the workspace. Each template is a folder under its channel, with one file per language and, for email, a template.json with the subjects.

nulvless/templates/
├── email/
│   └── welcome-user/
│       ├── template.json     { "subject": { "en-US": "Welcome to {{platform.name}}" } }
│       ├── en-US.html
│       └── pt-BR.html
└── sms/
    └── phone-otp-verification/
        └── en-US.txt

Files

<language>.htmlemailRequired

The email body for one language: en-US, pt-BR, pt-PT, es-MX, es-CO, es-ES, es-AR, fr-FR, fr-CA, de-DE or ko-KR.

<language>.txtsmsRequired

The SMS text for one language, from the same list.

template.jsonobjectOptional

subject per language, required for email. name and description describe a template of your own in the console.

Variables such as {{platform.name}} are filled in when the message is sent.

Replace a default

A folder named after a platform template, such as welcome-user, replaces the one Nulvless sends for the languages it has files for.

nulvless templates list --env main                            # see the defaults
nulvless templates new welcome-user --template welcome-user   # start from the default
nulvless templates push welcome-user --env staging

Add your own

nulvless templates new order-shipped --channel sms
nulvless templates push order-shipped --env staging

Keep the console and git in step

nulvless templates pull --env main    # bring console changes into git
nulvless templates push --env main    # send the workspace to production

Templates belong to an environment, so push and pull always take --env. Pushing to main asks for confirmation; pass --yes in CI.

On this page