EmailGateBot webhook for message text transformation
You can automatically transform text of messages for emails from the whitelist of the chat. To do this, you need to deploy a web server on the Internet that accepts POST requests at a permanent address. A request to this address should not require authorization.
Your code should read the original text string from the body of the incoming POST request, convert it according to the rules you specify, and return the result of the transformation in the response body. Note that the original string is passed exactly in the body of the request, and not as the value of some form field.
In @EmailGateBot, select the chat, and then the email address from the whitelist for which you want to enable text conversion. In the edit menu for this email address, select “Set text-transform” and specify the address of your server.
Now when a new email arrives, the bot will make a POST request to your server with the text of the received message and publish the response of your server to the chat.
This method can be used to extract only meaningful data from automatically generated emails (for example, notifications about messages from forums), automatic moderation of messages from certain email addresses, etc.
As a starting point, you can use the source code of the built-in EmailGateBot notification handler from some popular sites.