On 4/27/24 18:44, Mark wrote:
I created a text file as a custom welcome message and chowned it to mailman:mailman, then edited the database record (template.uri) from
http://localhost:8000/mailman3/api/templates/list/mytestlist.mydomain.com/li... TO file:///home/mark/welcome.txt
This delivered the custom welcome message to the user when subscribed via Mass Subscribe.
I'm not sure what this tells me other than a call can be made to a file but not the database.
The retrieval of a file does not involve calling requests.get() to retrieve the URL via http which is where the issue occurs.
There's another way to set templates in the file system. If there is no entry in the template table matching the requested template name and context the file system is searched according to the algorithm described at <https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/utilities/i18n.py?ref_type=heads#L47-107>. $template_dir in that description is Mailman's var/templates/ directory.
So for example, to create a lists specific english language welcome template for the list.example.com list you could just put the template in var/templates/lists/list.example.com/en/list:user:notice:welcome.txt or to make it sitewide, in var/templates/site/en/list:user:notice:welcome.txt
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan