listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Added support for sending transactional messages to external email addresses

Open ugd opened this issue 8 months ago • 1 comments

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/external to handle sending transactional messages to external email addresses. This endpoint uses the SendExternalTxMessage handler. (cmd/handlers.go, cmd/handlers.goR183)
  • Handler implementation: Implemented SendExternalTxMessage in cmd/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/external endpoint 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 ExternalTransactionalMessage schema 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 /tx endpoint in the Swagger file to better align with its purpose. (docs/swagger/collections.yaml, docs/swagger/collections.yamlR1915-L1918)

ugd avatar May 03 '25 19:05 ugd

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 to recipient_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" } } ]

josaladino2 avatar May 10 '25 19:05 josaladino2

This PR has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.

github-actions[bot] avatar Aug 11 '25 02:08 github-actions[bot]