[BUG] Templates not used/found
Tag/version of Container Images Choose from: 0.4.*
Standard docker install here. Defined some templates for mails, e.g. a welcome messge, but that never gets sent. Looks like mailman-core can not access the templates.
How must this be configured to work properly?
With the mailman-core section of docker-compose.yaml having a volume, you can add files directly to this directory on the docker host (i.e no need to place files inside the container directly.
/opt/mailman/core/var/templates/site/en
Note, you will need to create the site/en directories.
Then I created these files:
# ls -latr
-rw-r--r--. 1 100 root 415 Mar 27 12:45 list:admin:action:post.txt
-rw-r--r--. 1 100 root 384 Mar 27 12:47 list:admin:notice:disable.txt
-rw-r--r--. 1 100 root 314 Mar 27 12:48 list:admin:notice:increment.txt
-rw-r--r--. 1 100 root 322 Mar 27 12:48 list:admin:notice:pending.txt
-rw-r--r--. 1 100 root 688 Mar 27 12:49 list:user:action:invite.txt
-rw-r--r--. 1 100 root 535 Mar 27 12:56 list:user:notice:no-more-today.txt
-rw-r--r--. 1 100 root 628 Mar 27 12:57 list:user:notice:probe.txt
-rw-r--r--. 1 100 root 374 Mar 27 12:59 list:user:notice:rejected.txt
-rw-r--r--. 1 100 root 431 Mar 27 13:00 list:user:notice:warning.txt
-rw-r--r--. 1 100 root 609 Mar 27 13:01 list:user:notice:welcome.txt
-rw-r--r--. 1 100 root 0 Mar 27 13:49 list:member:regular:header.txt
-rw-r--r--. 1 100 root 0 Mar 27 13:49 list:member:regular:footer.txt
-rw-r--r--. 1 100 root 0 Mar 27 13:49 list:member:generic:footer.txt
-rw-r--r--. 1 100 root 0 Mar 27 13:50 list:member:digest:header.txt
-rw-r--r--. 1 100 root 0 Mar 27 13:50 list:member:digest:footer.txt
-rw-r--r--. 1 100 root 609 Mar 27 14:32 domain:admin:notice:new-list.txt
-rw-r--r--. 1 100 root 276 Mar 27 14:38 list:admin:notice:removal.txt
-rw-r--r--. 1 100 root 278 Mar 27 14:43 list:admin:notice:unsubscribe.txt
-rw-r--r--. 1 100 root 293 Mar 27 14:43 list:admin:notice:subscribe.txt
-rw-r--r--. 1 100 root 465 Mar 27 14:52 list:admin:notice:unrecognized.txt
-rw-r--r--. 1 100 root 303 Mar 27 15:06 list:admin:action:subscribe.txt
-rw-r--r--. 1 100 root 307 Mar 27 15:06 list:admin:action:unsubscribe.txt
-rw-r--r--. 1 100 root 416 Mar 27 15:07 list:member:digest:masthead.txt
-rw-r--r--. 1 100 root 796 Mar 27 15:08 list:user:action:subscribe.txt
-rw-r--r--. 1 100 root 769 Mar 27 15:08 list:user:action:unsubscribe.txt
-rw-r--r--. 1 100 root 317 Mar 27 15:08 list:user:notice:goodbye.txt
-rw-r--r--. 1 100 root 520 Mar 27 15:08 list:user:notice:hold.txt
-rw-r--r--. 1 100 root 192 Mar 27 15:10 list:user:notice:post.txt
-rw-r--r--. 1 100 root 405 Mar 27 15:10 list:user:notice:refuse.txt
-rw-r--r--. 1 100 root 740 Mar 27 15:12 help.txt
The empty (zero byte) files are for ones where I wanted to overwrite the defaults but having nothing shown for those now.
There are other folders you can create if you want domain wide or specific list templates, but site is perhaps the easiest for starting out.
It was a fun exercise writing new templates. Whilst there are no option for html and images, you can embedded special characters and still try to make the emails more useful for moderators etc. If you leave a space at the start it won't wrap the text.
Here is an example of the list:admin:notice:subscribe.txt file:
$member has been successfully subscribed to the List: "$display_name".
~~ Go online to work on this mailing list ~~
~~ https://yourwebsite/postorius/lists/$list_id/ ~~
📩 [ $display_name ] ➡️ [ Subscribed notice ] 🌐 [ Your Lists ] 📧 Help: help@youremail
There are links about the place explaining the template system further if needed and the directory structure for where to place things under the templates directory.
Oddly I haven't been able to make the new-list template be used, however perhaps this might work if using the API to create the list and using the right option to notify the new owner.
I obviously don’t want to create text files, but get them from the database which I manage through mailman-web.
I'm not sure how that would be obvious but yes there are other ways to configure templates.
Via mailman-web: postorius/domains/ there is a Templates button, and from each list there is a New Template button.
Via API: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/templates.html
If you don't configure anything there should be defaults for all types of emails.
Perhaps you can advise which context (domain or list) you have used to set a template currently, and if your not receiving any email at all, or if you are received the default (non-custom) emails.
It would be good to ensure you are receiving the default emails before attempting to add templates emails to override the defaults.
There may be some issues surrounding your language setting also, there are defaults for most languages, but I've only ever used the English ones.
Perhaps there is something here: https://lists.mailman3.org/archives/list/[email protected]/thread/QCA3B7WCPAT3WUAT526PPVHBWUBBXK6D/
Or if you search that list you may find more help.
This potentially isn't a problem related specifically only to this docker setup for Mailman.
Good luck with your setup journey :smile:
Defined some templates for mails,
Defined where? There are 2 places you can do, in the filesystem and also via Postorius. Both have been working before on the docker setup.
This issue has not been updated for more than 1year