Skip to content

Commit 3c7e4e2

Browse files
committed
feat: support for custom_return_path
1 parent 4bf36f8 commit 3c7e4e2

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

examples/domains.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99

1010
create_params: resend.Domains.CreateParams = {
11-
"name": "example.com",
11+
"name": "drish.dev",
1212
"region": "us-east-1",
13+
"custom_return_path": "outbound",
1314
}
1415
domain: resend.Domain = resend.Domains.create(params=create_params)
1516
print(domain)

resend/domains/_domains.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ class CreateParams(TypedDict):
6060
The region where emails will be sent from.
6161
Possible values: us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1'
6262
"""
63+
custom_return_path: NotRequired[str]
64+
"""
65+
By default, Resend will use the `send` subdomain for the Return-Path address.
66+
You can change this by setting the optional `custom_return_path` parameter
67+
when creating a domain via the API or under Advanced options in the dashboard.
68+
"""
6369

6470
@classmethod
6571
def create(cls, params: CreateParams) -> Domain:

tests/domains_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def test_domains_create(self) -> None:
6262

6363
create_params: resend.Domains.CreateParams = {
6464
"name": "example.com",
65+
"region": "us-east-1",
66+
"custom_return_path": "send",
6567
}
6668
domain = resend.Domains.create(params=create_params)
6769
assert domain["id"] == "4dd369bc-aa82-4ff3-97de-514ae3000ee0"

0 commit comments

Comments
 (0)