-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Added support for sending transactional messages to external email addresses #2454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to external recipients
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
…alidation and update documentation
…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. | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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": "#2454 (review)",
"url": "#2454 (review)",
"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. |
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/tx/external
to handle sending transactional messages to external email addresses. This endpoint uses theSendExternalTxMessage
handler. (cmd/handlers.go
, cmd/handlers.goR183)SendExternalTxMessage
incmd/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
/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)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)/tx
endpoint in the Swagger file to better align with its purpose. (docs/swagger/collections.yaml
, docs/swagger/collections.yamlR1915-L1918)