Skip to main content

C9 — Print, PDF & Email Template Gallery

Scope: All printable and exportable documents produced by the Ghasi Melmastoon frontend — guest receipts, invoices, registration cards, key envelopes, policy printouts, and marketing emails. Covers: anatomy, rendering pipeline, per-tenant theming, RTL support, and language support.

Rendering pipeline: PDF documents are generated server-side by reporting-service using Puppeteer (headless Chromium) + @ghasi/print-templates (React components rendered to HTML, then captured as PDF). The HTML templates are themed using the tenant's CSS variables from theme-config-service. Email templates use MJML + React Email for cross-client compatibility.


1. Document inventory

IDNameTriggerAudienceLanguage(s)RTL support
PD-01Guest receiptCheckout / payment capturedGuestTenant locale
PD-02Folio invoiceManual request or auto at checkoutGuest / FinanceTenant locale
PD-03Guest registration cardCheck-inGuest + Regulatoryps-AF, fa-AF, en-US
PD-04Key envelope labelKey issuanceFront desk (internal)Tenant locale
PD-05Reservation confirmation letterConfirmation (offline)GuestTenant locale
PD-06Tax / VAT reportMonthly, manualFinanceen-US (regulatory)
PD-07Daily guest registration exportDaily regulatory submissionAuthorityps-AF / fa-AF (Afghanistan)
PD-08Cash drawer EOD reportEnd of dayFinanceTenant locale
EM-01Booking confirmation emailPost-confirmationGuestGuest locale
EM-02Pre-arrival reminder email24h before check-inGuestGuest locale
EM-03Check-out receipt emailPost-checkoutGuestGuest locale
EM-04Cancellation confirmation emailPost-cancellationGuestGuest locale
EM-05Marketing / promotional emailTenant-authored, scheduledGuest (opted-in)Tenant locale

2. Print document specifications

PD-01 — Guest Receipt

Purpose: Proof of payment for the guest. Issued at checkout (and on request mid-stay).

Paper size: 80mm thermal (for POS printer) or A4 (for desktop print).

Anatomy:

[Tenant logo] [Property name]
[Property address] [Registration number]
[Divider]
RECEIPT / إيصال / رسید
[Divider]

Guest: [Name]
Room: [Number] – [Type]
Check-in: [Date] Check-out: [Date]
Nights: [N]

[Charges table]
Category Qty Amount
Room [N] AFN X,XXX
Taxes [N] AFN XXX
[...]
[Divider]
TOTAL AFN X,XXX

Payment: [Method]
Ref: [Payment reference or cash note]

[Barcode / QR linking to digital receipt]
[Tenant tagline]

RTL: The full document mirrors for ps-AF and fa-AF — text, table alignment, and logo placement.

Numerals rule (F4): All amounts, dates, and quantities in Latin numerals regardless of locale.

Theming: Logo + --color-primary for header and dividers. Tenant font fallback to Noto Naskh Arabic + Noto Sans.


PD-02 — Folio Invoice

Purpose: Detailed itemized invoice for corporate bookings or expense reports.

Paper size: A4.

Anatomy:

  • Header: logo, tenant name, address, VAT/tax registration number.
  • Invoice metadata: invoice number, issue date, due date, currency.
  • Bill-to section: guest or company name, address.
  • Line items table: charge date, category, description, unit price, qty, total.
  • Sub-totals per tax category.
  • Grand total.
  • Payment terms + footer.

Regulatory note: Afghanistan does not currently require standardized VAT invoices for small properties, but the template is structured to accommodate future VAT registration and cross-border compliance (Iran, Tajikistan).


PD-03 — Guest Registration Card

Purpose: Afghan law requires hoteliers to collect and retain guest identity data. The registration card is the paper artifact produced at check-in and signed by the guest.

Paper size: A4 or A5.

Fields (per Afghan Ministry of Interior requirements):

  • Full name (Pashto + Latin)
  • Nationality
  • Passport / ID number, issue date, expiry date
  • Date of birth
  • Occupation
  • Permanent address
  • Purpose of visit
  • Arrival date, departure date
  • Room number
  • Guest signature
  • Staff signature

Language: Bilingual Pashto + English (or Dari + English).

Digital signature: QR code links to the platform's digital record (for internal use; not submitted to authority without export).


PD-04 — Key Envelope Label

Purpose: Label printed and attached to the physical key envelope when a card key or mechanical key is issued.

Size: Printable on 80mm receipt printer or as a label from a standard label printer.

Content:

  • Property name + logo
  • Room number (large, bold)
  • Guest name
  • Check-in / Check-out dates
  • Key type (card / mechanical)
  • Barcode: reservation ID

PD-06 — Tax / VAT Report

Purpose: Monthly summary for tax filing (national tax authority, municipal tax authority).

Format: Tabular. Columns: date, reservation ID, guest name, room nights, room revenue, tax amount, payment method. One row per reservation within the period.

Exported formats: PDF (signed with tenant certificate, for filing) + CSV (for accounting software import).

Language: English (standard for regulatory reporting across target markets).

Numerals rule (F4): Latin numerals only (finance audit invariant).


PD-07 — Daily Guest Registration Export

Purpose: Afghan hotelier regulation requires daily submission of guest identity data to the local police authority (saranwali). This export produces the standardized file.

Format: PDF (signed) + CSV (for authority's system import where applicable).

Submission: Initiated by the receptionist at EOD via J-18 / W-10. Logged to audit trail.


3. Email template specifications

EM-01 — Booking Confirmation Email

Trigger: reservation.confirmed.v1 event → notification-service.

Stack: MJML + React Email. Renders to HTML; plain-text fallback auto-generated.

Anatomy:

[Tenant logo + brand header]
[Hero image or property photo]

"Your booking is confirmed!" / پیگیری تایید شد

Reservation: [REF]
Guest: [Name]
Property: [Name] | Room: [Type]
Check-in: [Date, Day, Time]
Check-out: [Date, Day]
Nights: [N]
Guests: [N]

[Rate breakdown table]
Room charges: AFN X,XXX
Taxes: AFN XXX
Total: AFN X,XXX
Paid: [Method]

[CTA Button: "View Booking"]
[CTA Button: "Add to Calendar" (ICS attachment)]

[Property address + map thumbnail]
[Cancellation / modification policy excerpt]
[Contact: phone, email, WhatsApp]

[Footer: unsubscribe | privacy policy | tenant name]

Theming: Tenant --color-primary for header background, CTA button, dividers. Logo from theme-config-service. If tenant has no custom theme: Ghasi default.

RTL support: MJML tables with dir="rtl" attribute for RTL locales. CTA buttons are styled inline.

Dark mode: @media (prefers-color-scheme: dark) styles embedded where supported.


EM-02 — Pre-Arrival Reminder

Trigger: 24 hours before check-in. Scheduled by notification-service.

Anatomy (condensed):

  • "Your stay at <Property> is tomorrow"
  • Room + dates summary
  • Check-in time and instructions
  • Directions / map thumbnail
  • Cancellation policy reminder
  • Contact details

EM-03 — Check-Out Receipt Email

Trigger: reservation.checked_out.v1notification-service.

Content:

  • Thank you message with guest name
  • Stay summary (dates, room, nights)
  • Itemized charge list (same as PD-01 but in email format)
  • "We'd love your feedback" + star rating link
  • Loyalty / return booking offer (if tenant has loyalty program enabled)

EM-05 — Marketing / Promotional Email

Trigger: Tenant-authored in control plane or via notification-service broadcast API.

Content blocks (tenant-configurable):

  • Hero image with overlay text
  • Promotion details (rate, dates, CTA)
  • Property highlights
  • Terms in fine print

Compliance:

  • Unsubscribe link (legally required in all target markets) in every email.
  • List-Unsubscribe header.
  • Only sent to guests who opted in to marketing at booking.

4. Rendering pipeline

Trigger event (reservation state change, EOD, etc.)

notification-service (for emails) / reporting-service (for PDFs)

Load tenant theme from theme-config-service (CSS variables)

Render @ghasi/print-templates React component to HTML

PDF: Puppeteer captures HTML → saves to Cloud Storage → signed URL returned
Email: MJML renders to email-safe HTML → sent via provider (SendGrid, Postmark, etc.)

Attach PDF link or inline PDF to notification

delivery confirmation logged to audit-service

5. Localization requirements

  • All string keys are from @ghasi/ui-melmastoon/i18n.
  • Date formatting: Gregorian date as primary; Hijri equivalence in parentheses for ps-AF / fa-AF / fa-IR.
  • Currency: amount in tenant's billing currency. If guest's display currency differs, show both (e.g., "AFN 12,500 (≈ USD 178)").
  • Numerals: Latin only (F4 rule).
  • Font embedding in PDF: Noto Naskh Arabic for RTL locales, Noto Sans for LTR. Fonts embedded in PDF via Puppeteer --disable-web-security font injection.

6. Open Questions

  • PD-07 (Guest Registration Export): should we support the specific CSV format used by the Afghan Ministry of Interior's submission portal, or a generic format? Format not yet publicly documented.
  • EM-05 Marketing emails: should tenant marketing emails be rate-limited to 1 per guest per 7 days to prevent spam?
  • PD-01 receipt QR code: what URL scheme? https://melmastoon.app/receipt/<signed-token> or https://<tenant-slug>.melmastoon.app/receipt/<token>?

References