Via the REST API (and the web interface), you can create and retrieve email templates for sending documents and Payroll Updates. This evidence is available only with a Premium license.
To retrieve a template, use the standard URL
/c/{firma}/sablona-mail/{id}.
You can of course also use a detail level.
To create a template, send XML/JSON to the URL /c/{firma}/sablona-mail.
If you want to attach the template to a document type (in this case, specifically an issued invoice type), send the following XML to the URL mentioned above:
<?xml version="1.0"?><winstrom version="1.0"> <typ-faktury-vydane> <kod>{kod}</kod> <nazev>FAV se šablonou</nazev> <modul>FAV</modul> <radaPrijem>code:FAKTURA-STANDARD</radaPrijem> <typDoklK>typDokladu.faktura</typDoklK> <sablonaMail> {text-sablony} </sablonaMail> <poznam>Šablona pro faktury vydané</poznam> </typ-faktury-vydane></winstrom>Template Example and FreeMarker Variables
The FreeMarker templating system is used.
Before saving the template, the application checks whether the template contains any disallowed expressions.
The following variables can be used in templates:
${application} – The name of the application, i.e. "ABRA Flexi"
${user} – The user object, which can be used for further processing
${company} – Company settings
${uzivatelJmeno} – Your first name
${uzivatelPrijmeni} – Your last name
${titulJmenoPrijmeni} – Your full name, including any academic titles
${nazevFirmy} – Company name
${object} – Generic access to the passed object
${doklad} – The document to be sent
Example of Using These Variables in a Template
Dobrý den, zasílám Vám doklad ${doklad}, jehož interní číslo je ${doklad.kod}. Jmenuji se ${uzivatelJmeno} ${uzivatelPrijmeni}, včetně mého titulu ${titulJmenoPrijmeni}, pracuji pro ${nazevFirmy}. Mé telefonní číslo je ${user.mobil}, DIČ firmy je ${company.dic}.