Skip to content

Commit ec6ff9f

Browse files
rehanvdmclaude
authored andcommitted
feat(domains): add click_tracking and open_tracking to CreateParams
Allow specifying click and open tracking options when creating a domain, rather than requiring a separate update call after creation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 54a412e commit ec6ff9f

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

resend/domains/_domains.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ class CreateParams(TypedDict):
162162
"""
163163
The custom subdomain used for click and open tracking links (e.g., "links").
164164
"""
165+
click_tracking: NotRequired[bool]
166+
"""
167+
Track clicks within the body of each HTML email.
168+
"""
169+
open_tracking: NotRequired[bool]
170+
"""
171+
Track the open rate of each email.
172+
"""
165173

166174
@classmethod
167175
def create(cls, params: CreateParams) -> CreateDomainResponse:

tests/domains_async_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ async def test_domains_create_async_with_tracking_subdomain(self) -> None:
190190
"name": "example.com",
191191
"region": "us-east-1",
192192
"tracking_subdomain": "links",
193+
"click_tracking": True,
194+
"open_tracking": True,
193195
}
194196
domain = await resend.Domains.create_async(params=create_params)
195197
assert domain["id"] == "4dd369bc-aa82-4ff3-97de-514ae3000ee0"

tests/domains_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ def test_domains_create_with_tracking_subdomain(self) -> None:
224224
"name": "example.com",
225225
"region": "us-east-1",
226226
"tracking_subdomain": "links",
227+
"click_tracking": True,
228+
"open_tracking": True,
227229
}
228230
domain: resend.Domains.CreateDomainResponse = resend.Domains.create(
229231
params=create_params

0 commit comments

Comments
 (0)