Creating custom email templates

Starting in Maximo® Application Suite 9.0.3, you can customize the emails templates that are used in Maximo Application Suite by creating a ConfigMap in Red Hat® OpenShift® Container Platform.

About this task

If you are using earlier versions of Maximo Application Suite, you can create custom emails in Maximo Application Suite 8.11.15 or 8.10.18.

Only emails that are sent by Maximo Application Suite system events can be customized. Emails that are sent by suite applications, such as Maximo Manage, cannot be customized.

The following email templates, including the template arguments, can be used as a baseline to create a custom template. The template arguments that are associated with each template are variables that represent specific values, such as the users display name and password.

Template name Description Template argument
AdminPasswordReset Sends a request to the administrator to reset a users password if the user clicks Forgot password on the login page.
  • user.displayName
  • password

    String. The user's new password is in plain text.

UsageAlertCritical Informs the administrator if AppPoints usage exceeded the capacity amount.
  • user.displayName

The following arguments are generated within sendmail.

  • links.login
  • links.saas_usage
UsageAlertWarning Informs the administrator if AppPoints usage is close to capacity.
  • user.displayName
  • alert.threshold

The following arguments are generated within sendmail.

  • links.login
  • links.saas_usage
UserAccountLocked Informs a user that their account is locked.
  • user.displayName
  • minutes

    If included, minutes is the time after which the account is unlocked. If not included, only an administrator can unlock the account.

UserPasswordReset Sends a temporary password to the user if a user needs to change their password or forgot their password.
  • user.displayName
  • code

    String. The password reset code.

  • expirationMinutes

    Number. The code expiration time in minutes.

UserPasswordResetConfirmation Sends a confirmation email after a user resets their password.
  • user.displayName
  • password

    String. The user's new password is in plain text.

UserPasswordResetFailed Sends a confirmation email if a users password did not reset.
  • user.displayName
UserSelfRegistrationAdminNotification Informs the administrator to approve an account request from a user who self-registered.
  • primaryEmail
  • phoneNumber

The following arguments are generated within sendmail.

  • links.admin_login
UserSelfRegistrationConfirmed Sends the account information to a user that self-registered after their account is ready to use.
  • user.displayName
  • user.username
  • adminSupportEmail

    String. Support email.

The following arguments are generated within sendmail.

  • links.login
UserSelfRegistrationInitiated Sends a verification email with a code that the user can enter to complete the self-registration process if a user self-registers on the login page.
  • displayName
  • code

    String. The self-registration code.

  • expirationMinutes

    Number. The code expiration time in minutes.

UserSelfRegistrationPendingAdminApproval Informs a user who self-registered that the administrator needs to approve their request to create an account.
  • user.displayName
  • adminSupportEmail

    String. Support email.

WelcomeUsername Sends the username to the user after the administrator creates a user.
  • user.displayName
  • user.username
  • passwordEmailToFollow

    Boolean. Set if the user is to be informed that their password is sent in a subsequent email.

  • selfRegisteredUser

    Boolean. Set if the user self-registered.

WelcomePassword Sends the initial password to the user after the administrator creates a user.
  • user.displayName
  • password

    String. The user's initial password is in plain text.

Procedure

  1. In the Red Hat OpenShift Container Platform console, in the Workloads section, select ConfigMap.
  2. Click Create ConfigMap and select YAML view.
  3. Enter the YAML syntax for the ConfigMap.
    The following example is for a custom email template to confirm a password reset.
    kind: ConfigMap
    apiVersion: v1
    metadata:
      name: custom-email-templates
      namespace: mas-myinstanceid-core
    data:
      UserPasswordReset: |
        MIME-Version: 1.0
        Content-Type: multipart/alternative; boundary=edf79c96c6bc4320ae4106a24320edb0; charset="UTF-8"
        Subject: Password reset confirmation / Confirmação de reconfiguração de senha: IBM Maximo Application Suite
    
        This is a multipart message in MIME format.
        template_name='{{ meta.template_name }}'
    
        --edf79c96c6bc4320ae4106a24320edb0
        Content-Type: text/plain; charset="UTF-8"
    
        ---------------------------------------------------------
        Password reset confirmation: IBM Maximo Application Suite
        ---------------------------------------------------------
    
        Dear {{ user.displayName }},
    
        An IBM Maximo Application Suite password reset was requested for the account that is associated with this email address.
        If you did not make the request, you can ignore this email and no further action is taken.
    
        To complete the reset, enter the included confirmation code in the password reset dialog.
    
        Confirmation code: {{ code }}
    
        {% if expirationMinutes -%}
        This code expires in {{ expirationMinutes }} minutes.
        {% endif -%}
    
        --------------------------------------------
        Need help?
        For technical support, visit IBM Support page: {{ links.ibm_support }}
        For suite support, see IBM Documentation: {{ links.mas_kc }}
        --------------------------------------------
        (c) 2023 IBM All rights reserved
    
        
        --------------------------------------------------------------------
        Confirmação de reconfiguração de senha: IBM Maximo Application Suite
        --------------------------------------------------------------------
    
        Caro(a) {{ user.displayName }},
    
        Uma reconfiguração de senha do IBM Maximo Application Suite foi solicitada para a conta que está associada a este endereço de e-mail.
        Caso não tenha feito a solicitação, ignore esse e-mail e nenhuma outra ação será tomada.
    
        Para concluir a reconfiguração, insira o código de confirmação incluído na caixa de diálogo de reconfiguração de senha.
    
        Código de confirmação: {{ code }}
    
        {% if expirationMinutes -%}
        Esse código expira em {{ expirationMinutes }} minutos.
        {% endif -%}
    
        --------------------------------------------
        Precisa de ajuda?
        Para obter suporte técnico, visite a página de suporte da IBM: {{ links.ibm_support }}
        Para obter suporte a conjuntos, consulte a documentação da IBM: {{ links.mas_kc }}
        --------------------------------------------
        (c) 2023 IBM Todos os direitos reservados
    
        --edf79c96c6bc4320ae4106a24320edb0
    If you use an existing email template as a baseline for a custom template, be aware that existing templates reference files, such as CommonHeader.html.j2, CommonFooter.html.j2, CommonFooter.txt.j2, and CommonPreamble.txt.j2. If those references are kept in the custom templates, make sure the content of these referenced files are also added to the custom-email-templates configmap, for example:
    data:
      ...
      CommonPreamble.txt.j2: |
        This is a multipart message in MIME format.
        template_name='{{ meta.template_name }}'
  4. To use the custom template, specify the template mode as custom in the SmtpCfg custom resource.
    1. In the Administration section, select Custom Resource Definitions.
    2. In the CustomResourcesDefinitions window, select the SmtpCfg file.
    3. On the Instances tab, select the instance that you want to update.
    4. On the YAML tab, in the spec.config section, enter custom for the templateMode property.
      spec:
        config:
          templateMode: Custom
  5. Save your changes.

What to do next

Validate that the custom template is working as expected by initiating the scenario where the email is sent. If the new template contains any errors, the email is not sent to the user.

You can also validate that the emails are sent as expected by checking the logs in the <instance_name>-sendmailapi and <instance_name>-coreapi pods.