feat: Add support for Web URLs in templates.
commita80f6d32252b6cf174f836210bc2157773672e46
authorAbhilash Raj <262-maxking@users.noreply.gitlab.com>
Tue, 2 Apr 2024 09:13:27 +0000 (2 09:13 +0000)
committerAbhilash Raj <262-maxking@users.noreply.gitlab.com>
Tue, 2 Apr 2024 09:13:27 +0000 (2 09:13 +0000)
tree36ae562b2f1b98cd23114cc5bd70c61e6dcd774f
parentf7e01d4f6212103f24d58da3f5deb6bc83574ef1
feat: Add support for Web URLs in templates.

This adds support to include the Web URLs in the default email templates
provided by Mailman. Since Postorius is an optional peice in Mailman 3,
we haven't had support for Web URLs so far.

The changes in this PR include:

1. Additional field on domain, web_host, which will typically be the
   public facing URL for Postorius, including the prefix. A typical
   value for it would be something like:

      ``https://lists.example.com/mailman3``

2. A new configuration section, ``urlpatterns``, which has the various
   patterns to generate URLs based on Postorius's default URL patterns
   using parameters like ``list_id``, ``domain``, ``base_url``
   (web_host).

* Update documentation

* Remove extra substitutions

* Update docs and add NEWS

* Add URL validator and some more tests.

* Fix qa

* Add tests for web_url utility method

* Doctest fixes

* qa fixes

* Rename web_host with base_url

* Fix doctests

* Update doctests

* Remove some old changes

* Remove jinja2

* feat: Add support for Web URLs in templates.

This adds support to include the Web URLs in the default email templates
provided by Mailman. Since Postorius is an optional peice in Mailman 3,
we haven't had support for Web URLs so far.

The changes in this PR include:

1. Additional field on domain, web_host, which will typically be the
   public facing URL for Postorius, including the prefix. A typical
   value for it would be something like:

      ``https://lists.example.com/mailman3``

2. A new configuration section, ``urlpatterns``, which has the various
   patterns to generate URLs based on Postorius's default URL patterns
   using parameters like ``list_id``, ``domain``, ``base_url``
   (web_host).

* Intermediate commit

* Initial work on the urlpatterns
18 files changed:
src/mailman/config/schema.cfg
src/mailman/database/alembic/versions/729a8f2045da_add_domain_webhost.py [new file with mode: 0644]
src/mailman/docs/NEWS.rst
src/mailman/handlers/decorate.py
src/mailman/handlers/tests/test_decorate.py
src/mailman/interfaces/domain.py
src/mailman/model/domain.py
src/mailman/rest/docs/domains.rst
src/mailman/rest/docs/rest.rst
src/mailman/rest/docs/templates.rst
src/mailman/rest/domains.py
src/mailman/rest/tests/test_domains.py
src/mailman/rest/tests/test_systemconf.py
src/mailman/rest/tests/test_validator.py
src/mailman/rest/validator.py
src/mailman/templates/en/list:admin:action:post.txt
src/mailman/utilities/tests/test_urls.py [new file with mode: 0644]
src/mailman/utilities/urls.py [new file with mode: 0644]