Skip to content

Conversation

ugd
Copy link

@ugd ugd commented May 3, 2025

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 added 7 commits April 18, 2025 15:00
feat: add /api/tx/external endpoint for sending transactional emails to external recipients
…either subscriber_emails or subscriber_email, and convert subscriber_email to subscriber_emails if provided
…cessing logic into SendExternalTxMessage function
…xMessage function, with validation for Messenger
| 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. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve updated the documentation to reflect the recent changes. Apologies for the earlier oversight.

@josaladino2
Copy link

josaladino2 commented May 10, 2025 via email

Copy link
Contributor

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 github-actions bot added the stale label Aug 11, 2025
@github-actions github-actions bot closed this Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants