Revision as of 14:41, 19 May 2015 by Greg.hill (talk | contribs) (Guard Customization)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Ox Guard Customization


Guard uses several templates for emails and the Guest reader. These templates are fully customizable, and can be customized at the global level, but also at the context/user level. Changing images, colors, and layout is easy. Changing the wording is also possible, though the translation tables will then need to be updated.

Template ID

Guard uses a template ID for choosing the templates to use. The template ID can be chosen for a user or context using the configuration cascade.


For any template below, a customized template can be created with the name x-templatename where x is the integer value of the template ID for the user. For example, if you wanted a custom password template based on the template "passwordtempl.html" for a context of users, you could create a template "2-passwordtempl.html" and assign the value com.openexchange.guard.templateID=2 to the context. Then, Guard will use any templates that start with "2-" for the context.



  • guesttempl.html - Email template used when sending to a guest user (not an OX account)
  • passwordtempl.html - Template used to send a new password to a guest user
  • oxpasswordtempl.html - Email template used when sending a new password to an OX user
  • resettempl.html - Template used when sending a password reset
  • oxtempl.html - Template used in Guard 1.2. Depreciated in 2.0

Guest Reader

  • reader.html - The main guest reader template. THIS IS NOT CUSTOMIZABLE WITH TEMPLATE ID. GLOBAL CHANGES ONLY. We recommend not changing this file and using the header, footer, and style sheets for branding.
  • header.html - Top header bar of the Guest reader
  • footer.html - Footer of the Guest reader
  • style.css - Style sheet for the Guest reader

Email Template GetText

In the HTML templates, wording is surrounded by a call to gettext, which will get the translation for the user. It is used in a HTML call <$gettext("text here")> Example:

<$gettext("You have received this email because $from has sent you a secure email message with OX Guard. You will receive a link to the secure message in a separate email.")>


Some email templates have space for variables depending on their function. The variable name will begin with $ such as the above example $from.

Guest Reader Translations

The Guest reader webpage uses i18next for translations. If changing the header and footer such that you need translation, use a call such as

PIN Required:

The "data-i18n" property results in the inner HTML wording being replaced with the translation (if available for the specified language)