Bug 48960 - Make email template variables configurable in self service
Summary: Make email template variables configurable in self service
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: Self Service
Version: UCS 4.4
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0-1-errata
Assignee: Bryan White
QA Contact: Florian Best
URL: https://help.univention.com/t/self-se...
Keywords:
: 54400 (view as bug list)
Depends on:
Blocks: 54550
  Show dependency treegraph
 
Reported: 2019-03-12 09:51 CET by Florian Best
Modified: 2022-06-08 20:11 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Customer ID: 47147
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-03-12 09:51:13 CET
The self service email template only knows the variables:
{link}, {token}, {tokenlink} and {username}.

There is no way to greet the user with his first and lastname.

https://help.univention.com/t/self-service-passwort-reset-ldap-attribute-in-e-mail/11442/2

We should make this configurable.
Comment 1 Thorsten univentionstaff 2022-02-01 10:18:37 CET
We should at least add {title}, {firstname}, {lastname} and {mailPrimaryAddress} address. Closing the duplicate https://forge.univention.org/bugzilla/show_bug.cgi?id=54400
Comment 2 Thorsten univentionstaff 2022-02-01 10:19:05 CET
*** Bug 54400 has been marked as a duplicate of this bug. ***
Comment 3 Thorsten univentionstaff 2022-02-01 10:20:36 CET
Can we set this to target release UCS5 and backport only when required?
Comment 6 Bryan White univentionstaff 2022-03-14 10:10:58 CET
The e-mail template for password reset tokens now supports additional placeholders for the properties `title`, `initials`,    `displayName`, `firstname`, `lastname`, `mailPrimaryAddress`,    `employeeNumber` and `organisation`.

univention-self-service.yaml
bcaa336f49e6 | feat[self-service]: make additional UDM user info fields available to self-service email templates

univention-self-service (5.0.1-19)
bcaa336f49e6 | feat[self-service]: make additional UDM user info fields available to self-service email templates
Comment 7 Florian Best univentionstaff 2022-03-14 10:14:16 CET
I added another commit which fixes:

univention-self-service (5.0.1-19)
2c59ca72c615 | Bug #48960: fix extraction of user properties with simple UDM API
    The function requires the original UDM object, not a simple UDM object.
    
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 344, in __error_handling
        six.reraise(etype, exc, etraceback)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 247, in execute
        function.__func__(self, request, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 102, in _decorator
        return func(self, request, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 185, in _decorated
        return func(self, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
        return function(self, request)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
        result = _multi_response(self, request)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
        return function(self, request)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
        return list(function(self, iterator, *nones))
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
        yield function(self, *args)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 689, in send_verification_token
        user_info = self._extract_user_properties(user)
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 658, in _extract_user_properties
        info_out = {field: user_obj.info.get(field, '') for field in message_fields}
      File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 658, in <dictcomp>
        info_out = {field: user_obj.info.get(field, '') for field in message_fields}
    AttributeError: 'UsersUserObject' object has no attribute 'info'
Comment 8 Florian Best univentionstaff 2022-03-15 14:26:17 CET
OK: email template may contain the new placeholders. If the value is not set an empty string will be inserted.
OK: YAML