Certificates

How IremboHub generates certificates — the template system, authoring flow, and workflow wiring.

IremboHub generates PDF certificates by merging a FreeMarker HTML template with application data at the moment a GENERATE_CERTIFICATE workflow action fires.

How it works

  1. Author a FreeMarker HTML template (.html) that references application variables with .vars["variableName"] syntax.
  2. Upload the template in the Service Management Portal → Document Generation.
  3. Call list_certificate_templates to get the template's code.
  4. Wire the code into the workflow's GENERATE_CERTIFICATE action under certificateTemplateCode.

Generating a template with the AI

Use generate_certificate_template to produce a complete, print-ready FreeMarker HTML file from a structured spec:

Generate a certificate template for the Business Registration service in English.
Fields: businessName (TEXT), registrationDate (DATE), businessType (SELECT).
Include an expiry date. Write the file to /tmp/business-registration-cert.html

The tool returns:

  • template_html — the generated FreeMarker HTML (or writes to output_path)
  • bound_variables — the variables bound from your input spec; note this reflects the fields you passed, not a scan of the output HTML, so a field left out of every sections entry still appears here even though it won't render (see Template Authoring)
  • issues / suggestions — validation feedback

After uploading the file, call list_certificate_templates to retrieve its code, then reference that code in the workflow action.

One template per locale

A service typically needs one template per supported language. Run generate_certificate_template once for each language (en-US, fr-FR, rw-RW) and upload all three. certificateTemplateCode on the workflow action uses the short locale keys (en, fr, rw), not the tool's language values — map each template's code accordingly:

"certificateTemplateCode": {
  "en": "BIZREG_CERT_EN",
  "fr": "BIZREG_CERT_FR",
  "rw": "BIZREG_CERT_RW"
}

What can go into a template

See Template Authoring for the full list of standard variables, FreeMarker syntax rules, and examples.

On this page