Template system

OpenInvite loads your HTML template, sanitizes it, then injects invitation data by element id. If a value is missing, the element is removed entirely.

Templates must be hosted and publicly available via an HTTPS web server.

Visit the official template repository for in-depth examples. Feel free to contribute to the repository, or clone and modify for your own uses. Template can easily be hosted and served via Github pages, Vercel, Netlify, or any other similar service.

Note: that all templates by nature must be publicly accessible. So if you plan to include personalized content that is not fed into the template via the data injection system, the template would technically be usable by other users. If you wish to keep the template private, I recommend hiding it behind a non-discoverable url (i.e. https://yourdomain.com/[uuid]). The template is consumed on the server, so the source URL is not exposed to the guests viewing your invitation. However, if you include any linked assets, such as images, their location will be discoverable. So to truly hide your template, those assets should be stored in a different location.

Core placeholder IDs

Use these ids in your HTML so OpenInvite can inject values:

  • title, date, time
  • location, address
  • notes, notes_2, notes_3
  • host_names
  • rsvp_yes_label, rsvp_no_label, rsvp_maybe_label
  • guest_name, guest_message, expected_adults, expected_kids, expected_total
  • map_link, registry_link, response, calendar_link

Example snippet

<section class="info">
  <h1 id="title">Your event title</h1>
  <p id="date">Date goes here</p>
  <p id="time">Time goes here</p>
  <div id="notes">Notes go here</div>
  <div id="notes_2">Second notes block</div>
  <div id="notes_3">Third notes block</div>
  <div id="response"></div>
</section>

Map behavior

If you provide a map embed HTML snippet, it is injected into map_link. If you only provide a URL, it is inserted as text or as the href on an anchor. If neither is provided, the element is removed.

Textarea formatting and markdown

Textarea-backed fields support line breaks and limited markdown. This applies to address, notes, notes_2, notes_3, and guest_message.

Supported markdown:

  • **bold**
  • *italic*
  • - list item
  • [link text](https://example.com)

Links support https, http, mailto, and relative /path URLs.

Allowed HTML

OpenInvite sanitizes your template. These tags are permitted:

  • a, b, blockquote, br, code, div, em, footer, header
  • h1, h2, h3, h4, h5, h6, hr, img, iframe
  • li, link, main, meta, ol, p, section, span, strong, style, ul

Allowed attributes include class, id, and style on all elements, plus safe attributes for a, img, link, iframe, and meta.

External assets

  • Scripts are blocked.
  • Only Google Fonts are allowed for external font loading.
  • Images must use https or data URLs.
  • Iframes are limited to Google Maps.

If your template depends on anything else, it will be stripped during sanitization.