feat(send): per-send from/fromName email overrides#9
Merged
Conversation
…w sends Adds optional per-message From identity overrides on email sends, mirroring the TypeScript SDK: - from_ (maps to wire `from`): bare From address override. Was raw-only; now also on template sends. - from_name (wire `fromName`): new on both send() and send_raw() — From display name, rendered as "Name <address>". Either can be set alone; both fall back to the connection's configured values. Added to TemplateSend/RawSend dataclasses, the serializer, and the sync + async clients, with tests and a README note.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional per-send From overrides on email sends — parity with the
TypeScript SDK — with identical behavior on templated (
send) and raw(
send_raw) sends:from_(wire fieldfrom) — From address override (bare address).Previously accepted on
send_rawonly; now also onsend.from_name(wire fieldfromName) — new on both: From display nameoverride, rendered by the server as
Name <address>.Either field can be set on its own; both fall back to the provider connection's
configured values. On managed sending, the
from_address is honored only onthe workspace's verified sending domain, while
from_namealways applies.Changes
TemplateSendgainsfrom_andfrom_name;RawSendgainsfrom_name(it already had
from_). Both serialize to thefrom/fromNamewirefields, and null values are pruned as before.
send()andsend_raw()accept the new keyword arguments on both the syncand async clients.
Tests / verification
from/fromNameserialization on templated and raw sends.pytest— 62 pass;mypyandruffclean.🤖 Generated with Claude Code
Generated by Claude Code