feat: add traits to Events API and update transactional response type#16
Merged
feat: add traits to Events API and update transactional response type#16
Conversation
There was a problem hiding this comment.
Bug: TypeScript Union Breaks Without Discriminator
Removing the type discriminator from RawEmailSendResponse and TemplatedEmailSendResponse prevents TypeScript from properly narrowing the TransactionalEmailSendResponse union. This makes it difficult for consumers to reliably distinguish between the two types, especially when the optional groupBy field is absent, and breaks existing type-guarding logic.
src/interfaces/types.ts#L121-L146
smashsend-node/src/interfaces/types.ts
Lines 121 to 146 in 064da8a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
we now support traits to our Events API!
IT'S MAGIC!! You can pass things like firstName, lastName, etc... and we'll create the user with those properties if you are sending an event for a user that wasn't in your CRM before.
on top, updating our transactional email response, we don't longer pass the original message to save on API bandwith (and because wasn't needed lol)
Note
Adds user traits support to Events API and BREAKING: simplifies transactional email send response types; bumps version to 1.16.0.
EventTraitsandEventIdentify;EventPayload.identifynow usesEventIdentifyand supports optionaltraits.RawEmailSendResponseandTemplatedEmailSendResponseto{ messageId, status, to, warning?, groupBy? }(raw) and{ messageId, status, to, warning? }; removefrom,subject,type,templatefields.contacts.deleteByEmail(email)endpoint integration and response shape.1.16.0.Written by Cursor Bugbot for commit 064da8a. This will update automatically on new commits. Configure here.