Skip to content

Commit

Permalink
chore: example docs and change spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
drish committed Aug 14, 2024
1 parent be124e2 commit 41ef623
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions examples/scheduled_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
}

# Throws a resend.exceptions.ValidationError
# when scheduled_at is not in ISO 8601 format
# when scheduled_at is not in ISO 8601 format.
#
# Here is an example on how to create a date in the ISO 8601 format:
# from datetime import datetime
# datetime.now().isoformat()
email: resend.Email = resend.Emails.send(params)

print(f"Email scheduled: {email['id']}")
Expand All @@ -34,4 +38,4 @@
email_id=email["id"]
)

print(f"Email cancelled: {cancel_resp['id']}")
print(f"Email canceled: {cancel_resp['id']}")
10 changes: 5 additions & 5 deletions resend/emails/_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _UpdateEmailResponse(TypedDict):
"""
id: str
"""
The ID of the scheduled email that was cancelled.
The ID of the scheduled email that was canceled.
"""


Expand All @@ -38,7 +38,7 @@ class _CancelScheduledEmailResponse(TypedDict):
"""
id: str
"""
The ID of the scheduled email that was cancelled.
The ID of the scheduled email that was canceled.
"""


Expand Down Expand Up @@ -105,11 +105,11 @@ class Emails:

class CancelScheduledEmailResponse(_CancelScheduledEmailResponse):
"""
CancelScheduledEmailResponse is the type that wraps the response of the email that was cancelled
CancelScheduledEmailResponse is the type that wraps the response of the email that was canceled
Attributes:
object (str): The object type
id (str): The ID of the scheduled email that was cancelled
id (str): The ID of the scheduled email that was canceled
"""

class UpdateEmailResponse(_UpdateEmailResponse):
Expand Down Expand Up @@ -198,7 +198,7 @@ def cancel(cls, email_id: str) -> CancelScheduledEmailResponse:
email_id (str): The ID of the scheduled email to cancel
Returns:
CancelScheduledEmailResponse: The response object that contains the ID of the scheduled email that was cancelled
CancelScheduledEmailResponse: The response object that contains the ID of the scheduled email that was canceled
"""
path = f"/emails/{email_id}/cancel"
resp = request.Request[_CancelScheduledEmailResponse](
Expand Down

0 comments on commit 41ef623

Please sign in to comment.