Skip to content

Add sending domain update and company info endpoints - #70

Open
mklocek wants to merge 1 commit into
mainfrom
add-sending-domain-update-and-company-info
Open

Add sending domain update and company info endpoints#70
mklocek wants to merge 1 commit into
mainfrom
add-sending-domain-update-and-company-info

Conversation

@mklocek

@mklocek mklocek commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds the sending-domain update endpoint and the nested company_info endpoints, which exist in the API (per email-sending.openapi.yml) but were missing from the SDK.

  • SendingDomains.updatePATCH on the domain, with UpdateSendingDomainRequest covering open_tracking_enabled, click_tracking_enabled, tracking_opt_out_enabled, auto_unsubscribe_link_enabled and inbound_enabled. The inner data class uses Boolean with @Builder and @JsonInclude(NON_NULL), so only the fields a caller sets are serialized and an explicit false survives.
  • CompanyInfo / CompanyInfoImpl — new resource on client.sendingApi().companyInfo() with getCompanyInfo / createCompanyInfo / updateCompanyInfo. The spec path is /api/domains/{domain_id}/company_info and the account is resolved from the API token, so it takes no accountId.
  • Response shape — the company-info methods return the CompanyInfoResponse envelope and callers read .getData(), matching Webhooks and the rest of this SDK rather than unwrapping in the impl.
  • DTOsmodel/request/companyinfo/{Create,Update}CompanyInfoRequest and model/response/companyinfo/{CompanyInfo,CompanyInfoResponse}.
  • SendingDomainsResponse — add tracking_opt_out_enabled. The API returns it and update writes it, so callers could not read back what they had just set. Both domain fixtures were updated to include it.
  • Wiring — adding the companyInfo field to MailtrapEmailSendingApi changes its Lombok @RequiredArgsConstructor signature, so MailtrapClientFactory.createSendingApi is updated in the same change.
  • Tests / examplesCompanyInfoImplTest plus an update case in SendingDomainsImplTest, four new fixtures, a new CompanyInfoExample, an update block in SendingDomainsExample, and README entries.

update on the domain itself stays on the account-scoped /api/accounts/{accountId}/sending_domains/{id} route with the sending_domain wrapper, consistent with create / get / delete on the same resource; the API accepts both that and the spec's account-less form.

Fills the gap against the OpenAPI spec: PATCH on a domain plus the
nested company_info GET/POST/PATCH.

Company info is its own resource on sendingApi().companyInfo(). The spec
path is /api/domains/{id}/company_info and the account comes from the
API token, so it takes no accountId. Its methods return the
CompanyInfoResponse envelope rather than unwrapping it, matching
Webhooks and the rest of this SDK.

Adding the field to MailtrapEmailSendingApi changes its Lombok
@requiredargsconstructor signature, so the factory call is updated with
it.

Also adds tracking_opt_out_enabled to SendingDomainsResponse. The API
returns it and update() writes it, so callers could not read back what
they just set.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ea0e99d-8124-4f66-9934-279b629e7a70


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mklocek
mklocek marked this pull request as ready for review August 25, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants