Added support for sending transactional messages to external email addresses
This pull request introduces functionality for sending transactional messages to external email addresses, along with corresponding API documentation updates. The most significant changes include adding a new endpoint, implementing the handler logic, and updating the Swagger documentation to reflect the new functionality.
New feature: Sending transactional messages to external email addresses
-
API endpoint addition: Added a new POST endpoint
/api/tx/externalto handle sending transactional messages to external email addresses. This endpoint uses theSendExternalTxMessagehandler. (cmd/handlers.go, cmd/handlers.goR183) -
Handler implementation: Implemented
SendExternalTxMessageincmd/tx.go. This handler processes multipart form data for file attachments, validates the message fields, renders the message using a template, and sends it via the configured messenger. (cmd/tx.go, cmd/tx.goR205-R346)
API documentation updates
-
New endpoint documentation: Documented the
/tx/externalendpoint in the Swagger file, including its description, request body schema, and expected responses. (docs/swagger/collections.yaml, docs/swagger/collections.yamlR1936-R1958) -
New schema definition: Added the
ExternalTransactionalMessageschema to the Swagger file, defining the required fields and optional properties for the new endpoint. (docs/swagger/collections.yaml, docs/swagger/collections.yamlR4105-R4137) -
Existing endpoint update: Updated the description and operation ID for the
/txendpoint in the Swagger file to better align with its purpose. (docs/swagger/collections.yaml, docs/swagger/collections.yamlR1915-L1918)
Please unsubscribe me. Thx--____________________________Joe Saladino @.*** (From my iPhone)+1(208) 971-7570“You never realize Jesus is all you needuntil Jesus is all you have.”--Timothy Keller (The Prodigal Prophet)Joe's ProfileOn May 10, 2025, at 12:45 PM, Facecube @.***> wrote: @Facecube commented on this pull request.
In docs/docs/content/apis/transactional.md:
-```json -{
- "data": true
-}
+| Name | Type | Required | Description |
+|:------------------|:----------|:---------|:---------------------------------------------------------------------------|
+| recipient_email | string | | Email of the recipient. Can substitute with
recipient_emails. | +| recipient_emails | string[] | | Multiple recipient emails as alternative torecipient_email. | +| template_id | number | Yes | ID of the transactional template to be used for the message. | +| subject | string | Yes | Subject of the email. |
Just had a quick look to see how the API has changed, compared to my old reference implementation #1754. I am a bit sceptical on the mandatory subject, because this diverges from the existing ecosystem quite a bit. I have not fully checked out the code changes, but I assume you made that decision to guarantee a smoother integration of the new API? Lets see what @knadh thinks.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.> [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/knadh/listmonk/pull/2454#pullrequestreview-2831031650", "url": "https://github.com/knadh/listmonk/pull/2454#pullrequestreview-2831031650", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { @.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
This PR has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.