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.
Create
A new e-mail, SMS or e-Boks template, with an example of each
Get
One template with every setting
Update
Change the fields you send, and nothing else
Preview
The texts as sent, and an SMS's length and cost
Endpoints
| Method | Path | |
|---|---|---|
GET | /api/v2/{company}/emailTemplates/get | List every template, as stored |
GET | /api/v2/{company}/emailTemplates/{id}/get | Get one template |
POST | /api/v2/{company}/emailTemplates/create | Create a template |
POST | /api/v2/{company}/emailTemplates/{id}/update | Update a template (PATCH works too) |
DELETE | /api/v2/{company}/emailTemplates/{id}/delete | Delete a template (POST works too) |
POST | /api/v2/{company}/emailTemplates/preview | Preview 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
type | What the recipient gets | Settings block |
|---|---|---|
email | An e-mail with a button to the signing page | email: sender, subject, heading, text, button and design |
sms | An SMS with the link | sms: sender name (at most 11 characters) and text |
eboks | A message in e-Boks: the documents, or your own Word letter with a button to them | eboks: 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:
| Situation | Sent |
|---|---|
| (the block itself) | The invitation to sign |
reminder | A reminder |
read | To a recipient who only reads |
approve | To an approver |
allSigned | When 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.