Customize emails for two factor authentication
This page describes how to customize the emails that the platform will send to users with security codes for two-factor authentication
Abiquo will customize emails using template and properties files with the following priority:
Localized files, with a language code extension, such as
2FAEmailTemplate_en_US.mustache
and2fAEmail_en_US.properties
Files with no language code extension, such as
2FAEmailTemplate.mustache
and2fAEmail.properties
System defaults, with content as shown in the examples below
To customize the email to send a verification code for two-factor authentication:
Log in to the Abiquo API Server as an administrator
In the config folder, if there is no mail folder, create a mail folder and set the owner as the tomcat user
/opt/abiquo/config/mail
In the mail folder, In the
mail
folder, create the custom files as required. You can create localized files and main files.
The content of the default files is shown here.Email file:
for example, as a localized file for US English, 2FAEmailTemplate_en_US.mustache
<p>Hi {{username}},</p> <p>You can use the following verification code to complete the authentication process:</p> <p><strong>{{code}}</strong></p> <p>The code will be valid until: {{expiration}}</p> <p>If you did not request the verification code, please ignore this email.</p> <p>Thank you,</p> <p>The Abiquo Team</p>
Properties file:
for example, as a localized file for US English, 2faEmail_en_US.propertiessubject=Abiquo two factor authentication code
If you change the
subject
property, you must restart the Tomcat server to apply your changesYou cannot set the
username
,code
, orexpiration
. If you set these values, the platform will overwrite themOptionally, add custom variables and content
In the email body, to add a custom variable, use double curly braces (also called double mustaches), which is
{{
and}}
. For example,Then in your properties file, set value for your custom variable
To return unescaped HTML as part of a template property, use the triple mustache, which is
{{{
and}}}
.
The Mustache templating software that adds the property values will escape HTML variables in double mustaches by default.
If your users have a language other than English, rename the file to change the language code to the user language
For example, for
Spanish - Spain
changeen_US
toes_ES
The user language is the UI language when you create the user
Change the owner of the files to the
tomcat
userIf you changed the subject property, restart the Tomcat server
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved