Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page describes how to customize emails to notify users of the VM password set by the platform

Tip

Abiquo will customize emails using template and properties files with the following priority:

  1. Localized files, with a language code extension, such as guestPasswordTemplate_en_US.mustache and guestPassword_en_US.properties

  2. Main files with no language code extension, such as guestPasswordTemplate.mustache and guestPassword.properties

  3. System defaults. The platform uses the contents of the system default files in the examples below

To customize emails to notify users of the guest password:

  1. Log in to the Abiquo API Server as an administrator

  2. In the config folder, if there is no mail folder, create a mail folder and set the owner as the tomcat user

    Code Block
    /opt/abiquo/config/mail
  3. In the mail folder, create the following files

    1. Email file

      guestPasswordTemplate_en_US.mustache

      Code Block
      languagexml
      <p>Hi {{username}},</p>
      <p>Your new virtual machine is up and running. You can access it using the following credentials:</p>
      <p>
      Virtual machine UUID: {{vmuuid}}<br/>
      Virtual machine name: {{vmname}}<br/>
      Virtual machine providerID: {{vmproviderid}}<br/>
      FQDN: {{fqdn}}<br/>
      Username: {{loginuser}}<br/>
      Password: {{loginpassword}}
      </p>
      <p>The Abiquo Team</p>
    2. Properties file

      guestPassword_en_US.properties

      Code Block
      subject=New Virtual machine {0}

      (warning) If you change the subject property, you must restart the Tomcat server to apply your changes

    3. The only variable that you can set in the default message is the subject 

    4. If the Fully qualified domain name is not set in the VM, the value of the FQDN variable will be

...

    1. undefined

...

    1. .

  1. Optionally add custom variables and content

    1. In the email body, to add a custom variable, use double curly braces (also called double mustaches). For example

      Code Block
      <p>Please call your system Administrator on <strong>{{helpline}}</strong></p>
    2. Then in your properties file, set value for your custom variable

      Code Block
      helpline=555 12345

      (tick) To return unescaped HTML as part of a template property, use the triple mustache, which is

...

    1. {{{

...

    1. and

...

    1. }}}

...

    1. .
      The Mustache templating software that adds the property values will escape HTML variables in double mustaches by default.

  1. If your users have a language other than English, rename the file to change the language code to the user language 

    1. For example, for

...

    1. Spanish - Spain

...

    1. change the en_US to es_ES

    2. The user language is the

...

    1. language of the locale of the user

  1. Change the owner of the files to the 

...

  1. tomcat user