From eef751f92d8e0117f07910acdbd48ba032d5de27 Mon Sep 17 00:00:00 2001 From: bobbyonmagic <237182227+bobbyonmagic@users.noreply.github.com> Date: Tue, 13 Oct 2026 11:57:11 +0000 Subject: [PATCH] Sync with the API spec --- spec/openapi.json | 10 ++++++++++ src/smtpfast/types.py | 2 ++ 2 files changed, 12 insertions(+) diff --git a/spec/openapi.json b/spec/openapi.json index 6c98024..651014c 100644 --- a/spec/openapi.json +++ b/spec/openapi.json @@ -16702,6 +16702,16 @@ "description": "Defaults to marketing. Label receipts, password resets and other transactional mail transactional so a marketing opt-out does not block them; unlabelled mail is treated as marketing. Over SMTP, set the X-SMTPfast-Category header instead; it is removed before sending. An email whose html or text (for a template, the rendered body) contains an unsubscribe placeholder is always marketing. A marketing email carries the one-click List-Unsubscribe header and is not sent to anyone who unsubscribed. A transactional email has no List-Unsubscribe header and still goes to addresses whose suppression has scope marketing (a recipient's own unsubscribe, or a manual suppression created with scope marketing), but not to addresses with scope all: hard bounces, complaints, and manual suppressions, which block everything by default. Transactional means mail the recipient needs because of an action or account; labelling promotions transactional is not allowed. Any other value is refused with 400.", "example": "transactional" }, + "track_clicks": { + "type": "boolean", + "description": "Not in Resend, which sets tracking per domain. Rewrite this email's links through the click tracker (true) or send them exactly as written (false). Left out, the account's tracking settings apply, including the setting for transactional email. Over SMTP, set the X-SMTPfast-Track-Clicks header to true or false instead; it is removed before sending. To keep one link out of tracking, such as a password reset link with a token, add data-smtpfast-track=\"off\" to its tag; the attribute is removed before sending. null is the same as leaving it out; any other value that is not true or false is refused with 400.", + "example": false + }, + "track_opens": { + "type": "boolean", + "description": "Not in Resend. Add the open-tracking pixel to this email (true) or not (false). Left out, the account's tracking settings apply. Over SMTP, set the X-SMTPfast-Track-Opens header to true or false instead; it is removed before sending. null is the same as leaving it out; any other value that is not true or false is refused with 400.", + "example": false + }, "html": { "type": "string", "description": "HTML body of the email. Include `{{unsubscribe_url}}` (or the Resend-compatible `{{{RESEND_UNSUBSCRIBE_URL}}}`) anywhere in the body and SMTPfast substitutes the per-recipient unsubscribe link at send time. An email with the placeholder is always marketing, and a marketing email gets the same URL on the RFC 8058 `List-Unsubscribe` header.", diff --git a/src/smtpfast/types.py b/src/smtpfast/types.py index 3ac9fb8..f33053f 100644 --- a/src/smtpfast/types.py +++ b/src/smtpfast/types.py @@ -464,6 +464,8 @@ "headers": NotRequired[dict[str, str]], "scheduled_at": NotRequired[str], "category": NotRequired[Literal["transactional", "marketing"]], + "track_clicks": NotRequired[bool], + "track_opens": NotRequired[bool], "html": NotRequired[str], "text": NotRequired[str], },