.. SPDX-FileCopyrightText: 2024 - 2025 Univention GmbH
..
.. SPDX-License-Identifier: AGPL-3.0-only

.. _customization-theme-self-service-mails:

Customization of self-service emails
====================================

.. dropdown:: Deployment — Kubernetes
   :color: info
   :icon: rocket

   This page refers to the Nubus for Kubernetes deployment.

This chapter describes which self-service emails you can customize and how to do it.
You need the Helm Chart for Nubus, your customized deployment file :file:`custom_values.yaml`,
and the files for customization described in this chapter.

You can customize the self-service emails for the password reset.

.. _customization-theme-self-service-mails-password-reset:

Configure password reset
------------------------

To configure a custom password reset email body,
add the configuration value :envvar:`nubusUmcServer.selfService.passwordresetEmailBody`
to your :file:`custom_values.yaml` deployment file
and configure the text, as you like.
You can use the following placeholders in curly brackets
to customize the message for the user
that requests a password reset:

:``username``: The username of the user that wishes to reset their password.
:``token``: The token for the password reset.
:``link``: Link to the *Password Reset* website.
:``tokenlink``: Link to the *Password Reset* website with the username and token already entered.

:numref:`customization-theme-self-service-mails-password-reset-listing` shows an example.
To apply the changes, see the steps in :ref:`customization-theme-self-service-mails-apply`.

.. code-block:: yaml
   :caption: Example for customizing the password reset email body
   :name: customization-theme-self-service-mails-password-reset-listing

   nubusUmcServer:
     selfService:
       passwordresetEmailBody: |
         Dear user {username},

         we have received a password reset request for your account. If you did not
         wish to change your password, you can safely ignore this message.

         To change your password please follow this link:

         {tokenlink}

         If the link does not work, you can go to

         {link}

         and enter the following token manually:

         {token}

         Greetings from your password self-service system.

.. _customization-theme-self-service-mails-apply:

Apply configuration changes
---------------------------

To apply the updated configuration in your :file:`custom_values.yaml` deployment file to Nubus,
run the commands in :numref:`customization-theme-self-service-mails-apply-listing`.
Kubernetes automatically updates the ``ConfigMap`` and restarts the affected Kubernetes pods to
apply the changes.

.. code-block:: console
   :caption: Apply customization to Nubus
   :name: customization-theme-self-service-mails-apply-listing

   $ export NAMESPACE_FOR_NUBUS="Set to your Kubernetes namespace"
   $ export RELEASE_NAME="The Helm Chart release name"
   $ export VERSION="Your version of Nubus"
   $ helm upgrade \
      "$RELEASE_NAME" \
      --namespace="$NAMESPACE_FOR_NUBUS" \
      oci://artifacts.software-univention.de/nubus/charts/nubus \
      --values custom_values.yaml \
      --version "$VERSION"
