NextSign API
Email Templates

Email Templates

Create, read, change, delete and preview the e-mail, SMS and e-Boks templates your cases send, with /api/v2/{company}/emailTemplates.

A message template decides what a case sends its recipients: the e-mail, the SMS or the e-Boks message, with its sender, texts and design. These are the templates under Skabeloner in the dashboard. A template made through the API opens and saves there like any other, and the other way round. Despite the name, every route here covers all three types.

Endpoints

MethodPath
GET/api/v2/{company}/emailTemplates/getList every template, as stored
GET/api/v2/{company}/emailTemplates/{id}/getGet one template
POST/api/v2/{company}/emailTemplates/createCreate a template
POST/api/v2/{company}/emailTemplates/{id}/updateUpdate a template (PATCH works too)
DELETE/api/v2/{company}/emailTemplates/{id}/deleteDelete a template (POST works too)
POST/api/v2/{company}/emailTemplates/previewPreview what a template sends

All are on https://www.nextsign.dk. Use your company's API key as bearer token, as for the other v2 routes:

Authorization: Bearer YOUR_API_KEY

{company} is your company id. Your credentials only reach your own company's templates: another company's template answers 404 template-not-found, the same as an id that does not exist.

The three types

typeWhat the recipient getsSettings block
emailAn e-mail with a button to the signing pageemail: sender, subject, heading, text, button and design
smsAn SMS with the linksms: sender name (at most 11 characters) and text
eboksA message in e-Boks: the documents, or your own Word letter with a button to themeboks: solution, inbox title, button and letters

A template has a type, a name, a language and one settings block named after its type:

{
  "type": "sms",
  "name": "Underskrift via SMS",
  "language": "da",
  "sms": { "senderName": "LandPlan", "body": "Hej {recipient_name}, underskriv {case_name} her: {recipient_url}" }
}

You send this shape to create and update a template, and Get returns it with every setting filled in.

Situations

One template covers every message a case sends a recipient. The texts in the block are the invitation. The texts for the other messages go under situations:

SituationSent
(the block itself)The invitation to sign
reminderA reminder
readTo a recipient who only reads
approveTo an approver
allSignedWhen everyone has signed

An empty text ("") sends NextSign's standard text in the template's language, so you only write the texts you want to change.

Placeholders

Texts can contain placeholders that are filled per case and recipient, such as {recipient_name}, {case_name} and {company_name}. Placeholders lists them all. An unknown placeholder is not refused, but the answer warns about it in warnings.

Every setting

The requests and answers are exactly those of API v3, including status codes and errors. The reference there describes each setting, SMS length and cost, and e-Boks letters: Message Templates.

Use a template on a case

Pass the template's id as emailtemplate when you create a case, or as a recipient's template for an SMS or e-Boks template.

For a one-off wording, you can also write the template into the case request itself, as messageTemplate. It is then saved for that case only and never listed: see A Template for This Case Only.

Templates have no draft. A change is used from the next send of every case, preset, form and mass send that uses the template, including reminders on cases already sent.

Request size

A v2 request can be at most about 4 MB. Give a bigger e-Boks letter by url, or use v3, which takes up to 15 MB.