Quick introduction: I implemented phplist into my forum (smf forum) 7 years ago. At that time, there was no API and I had to do some reverse engineering and had to implement quite some code to add / remove a subscriber and handle it’s subscription list.
Fast forward now, I upgraded it to the latest version and ran into quite a few issues and pain points and want to better integrate everything.
The documentation for the API isn’t ideal and leads to dead links as well, so my first question is where can I find the documentation for the endpoints?
I found this github(dot)com/phpList/rest-api/blob/phplist3/docs/Api/RestApi.apib in main branch there is just an empty doc folder.
My goal is actually simple: Add / remove subscriber (by email), modify it’s subscribed list, modify an attribute (group association).
By the looks of it, in those 7 years this is all not possible yet? In main I get a few more endpoints but they are all marked with “Status: Beta – This method is under development. Avoid using in production.” ![]()
Then I have a few special use cases which I originally had to modify in phplist code directly, but upgrading it every time is just such a waste of time:
- Use an html list (ul and li tags) instead of the “* %listname%\n” text.
I couldn’t find any way to modify the [LISTS] placeholder
My attempt today to use a custom plugin failed, because I can’t seem to get any entry point for the system mails:
parseFinalMessage -> nope
parseOutgoingTextMessage -> nope
parseOutgoingHTMLMessage -> nope
Is there another way to catch the text before it will be sent out?
-
I introduced a [FROMEMAIL] placeholder, which replaces the text with the formmail.
This works fine for campaign emails with the above hooks (parseOutgoingXYZ) but again, doesn’t work for system emails -
When converting the HTML to text version (HTML2Text) I would like to remove some html blocks or do custom parsing. For example the “ul li” list won’t be parsed correctly and it’s just one line instead of a nice list

My other use case ist to remove html header formatting:
I use MJML to generate nice HTML emails and they also do have a header and a preview block.
But the conversion to text is “not nice” and I would like to remove the head html and also change the preview text.
I also had to modify the source code here to make it fit.
Time is precocious, but I’m willing to contribute some time and create PRs to improve the situation if there is interest and if these PRs will make it quickly into a new release if the provided PR is solid.
My suggestion would be:
- Add new hooks for system messages (like parseOutgoingSystemTextMessage & parseOutgoingSystemHtmlMessage) or rewrite the code so that system also uses the existing ones (but this could lead to unwanted effects with previous code / hooks)
- Or maybe add a new hook for ALL outgoing texts / before it gets sent?
- My quick testing revealed that parsePlaceHolders is called by both and this could also be a great hook point to add custom placeholders
- add a new hook to customize the [LIST] placeholder - or introduce a new function which all placeholders use and add there a hook so that we can modify all placeholders
- add a pre and post hook for HTML2Text function
I know many ideas, some are quicker to implement and some require more discussion.
Feedback welcome, would love to contribute something to make it official and to avoid a custom solution where no body will benefit from and is harder for me to maintain.