Univention Bugzilla – Bug 48960
Make email template variables configurable in self service
Last modified: 2022-06-08 20:11:45 CEST
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.
We should at least add {title}, {firstname}, {lastname} and {mailPrimaryAddress} address. Closing the duplicate https://forge.univention.org/bugzilla/show_bug.cgi?id=54400
*** Bug 54400 has been marked as a duplicate of this bug. ***
Can we set this to target release UCS5 and backport only when required?
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
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'
OK: email template may contain the new placeholders. If the value is not set an empty string will be inserted. OK: YAML
<https://errata.software-univention.de/#/?erratum=5.0x261>