MT-22691: Contacts & events - #21
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughAdds Contacts and Contact Events services to the Mailtrap Go client, wires them into the client, and adds tests, examples, and README links for the new email marketing functionality. ChangesEmail Marketing API additions
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Example as Example Program
participant Client
participant ContactsService
participant ContactEventsService
participant MailtrapAPI
Example->>Client: NewClient(token)
Example->>Client: Contacts.Create(req)
Client->>ContactsService: Create(req)
ContactsService->>MailtrapAPI: POST /api/contacts
MailtrapAPI-->>ContactsService: Contact
ContactsService-->>Example: Contact
Example->>Client: ContactEvents.Create(identifier, req)
Client->>ContactEventsService: Create(identifier, req)
ContactEventsService->>MailtrapAPI: POST /api/contacts/{identifier}/events
MailtrapAPI-->>ContactEventsService: ContactEvent
ContactEventsService-->>Example: ContactEvent
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lorenc326
force-pushed
the
MT-22691-contacts
branch
from
July 9, 2026 09:19
526cb8b to
1929ea4
Compare
IgorDobryn
approved these changes
Jul 9, 2026
mklocek
approved these changes
Jul 10, 2026
Lorenc326
force-pushed
the
MT-22691-contacts
branch
from
July 10, 2026 10:35
1929ea4 to
b82c333
Compare
Merged
2 tasks
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.
Motivation
Adds the Contacts core of the Email Marketing API to the Go SDK: manage contacts and record custom contact events.
Changes
client.Contacts):Create/Get/Update/Deleteby UUID or email. Responses aredata:-unwrapped; requests wrap in{contact:…}.Updateis an upsert — it returns{Action, Contact}reporting whether the contact was created or updated. The email identifier is URL-encoded for you.client.ContactEvents):Create— record a custom event (name + scalar params) for a contact.examples/contacts+examples/contact-events+ README "Email Marketing" entries.Field shapes and paths verified against the OpenAPI spec (
contacts).How to test
go test -race ./...go vet ./...golangci-lint run ./...Summary by CodeRabbit