openemail.settings
Every method in this namespace: its signature, its parameters, what it returns and an example.
Methods
Mailbox preferences such as timezone and language, the workspace's privacy, and the signature, tracking and privacy of each address or domain.
settings.get()
Read settings
def get( *, address: str | None = None, api_key: str | None = None, timeout: float | None = None,) -> SettingsResourceReturns every setting with defaults filled in, so a field that was never saved still has a value and reading one never depends on which release introduced it. SettingsResource is a plain dict[str, Any] with every setting under its own key and the scope's own overrides.
Without address= it is your account and the workspace. The account fields (language, time zone and formats, theme, sounds, notifications and the rest) are the caller's own: for an API key the workspace owner's, for a connected app the person who connected it. The privacy fields and workspaceName are the workspace's. signature, openEmailSignature, trackOpens and trackClicks belong to each address and read as the built-in defaults here: no signature, the OpenEmail footer on, and open and link tracking off.
With address=, the fields as they apply to that scope: one address, *@domain for a catch-all or @domain for a whole domain. For an address the four per-address fields resolve the way a send from it does: the address's own values, then its domain's catch-all when the catch-all caught that address rather than it being one you created, then the built-in defaults, and a plus address with no settings of its own reads its base address's. externalImages, trustedSenders and the blocklist resolve from the workspace, then the domain, then the catch-all, then the base of a plus address, then the address itself, and the last of them that sets a field wins. @domain reads the workspace's privacy with the domain's own on top. Every other field reads the same whatever the scope.
overrides holds what the scope sets itself, the fields update can send None for at the same scope, and everything not in it is inherited. address on the result is the scope you named, lowercased, or None.
Parameters
addressstrThe scope to read: one address,
*@domainfor the catch-all of a domain, or@domainfor a whole domain. A key narrowed to particular addresses or domains may name only an address it holds, and a catch-all or a domain only when it holds that domain whole, or the call is a 422capability_unsupported.api_keystrOverrides the client's API key for this call only.
timeoutfloatSeconds this call may take, the response included, before it raises
OpenEmailNetworkErrorwithis_timeout. It overrides the client'stimeoutfor this call, and0turns the limit off.
Returns
SettingsResource, a dict with 'object': 'settings', every setting and the scope's own overrides.
Example
from openemail import openemail workspace = openemail.settings.get() print(workspace.get('timezone'), workspace.get('language')) sales = openemail.settings.get(address='[email protected]') print(sales.get('signature'), sales.get('trackOpens'), sales.get('trackClicks'))Notes
A stored
signaturelonger than 150,000 characters reads back as an empty string instead of failing the request.defaultEmailAliasonly preselects the From address in the app composer. The API never uses it to choose a sender.
Also available in
- API
GET /settings- TypeScript
settings.get()- Ruby
settings.get- PHP
settings->get- Go
Settings.Get- Java
settings().get- C#
Settings.GetAsync- CLI
openemail settings get
settings.update()
Change settings
def update( patch: SettingsPatch, *, address: str | None = None, api_key: str | None = None, timeout: float | None = None,) -> SettingsResourceA partial update: fields you send are validated and saved, fields you leave out keep their values, a list replaces the old one, and the response is the full settings dict read back after the write, in the same shape get returns for the same scope.
Without address= it changes your account and the workspace. The account fields (language, time zone and formats, theme, sounds, notifications and the rest) are saved on the caller's account: for an API key the workspace owner's, for a connected app the person who connected it. workspaceName renames the workspace, and is a 422 invalid_parameter on a personal space, which has no name of its own. The privacy fields (externalImages, trustedSenders, blockedSenders, blockedDomains, blockedWords, useDefaultBlockedWords, semanticSearch, replySuggestions, knowledgeLearning) and the marketing footer fields (marketingSenderName, marketingPostalAddress) are saved on the workspace, and None removes the workspace's own value so the default applies again. A key narrowed to particular addresses or domains may change none of those workspace fields or the name, and gets a 422 capability_unsupported. signature, openEmailSignature, trackOpens and trackClicks are refused there with a 422 address_required naming the field, because they are set on each address, and nothing is written. 'semanticSearch': False turns search by meaning off for the workspace: its mail stops going to the embedding model, what was stored is deleted at once, and threads.list with semantic=True runs a text search until it is turned back on. 'replySuggestions': False turns suggested replies off for the workspace: no thread goes to a model for them any more, what was stored is deleted at once, and threads.reply_suggestions answers none until it is turned back on. 'knowledgeLearning': False stops the knowledge base learning for the workspace: no sent reply is read for facts to suggest, no question is noted from incoming mail, and no pair of items is checked for a conflict, while what was already suggested stays for review. Keys the settings schema does not know are dropped silently rather than refused, and a known key with the wrong type, or None for a field that cannot be cleared, is a 422 invalid_parameter naming it.
With address=, the patch gives that scope a choice of its own. One address or a catch-all (*@domain) takes signature, openEmailSignature, trackOpens, trackClicks, externalImages, trustedSenders, blockedSenders, blockedDomains, blockedWords and useDefaultBlockedWords, and a whole domain (@domain) the last six only. None removes the scope's own value, so it inherits again from the scope above it, and overrides on the result lists what the scope still sets itself. Any other field is a 422 not_per_address naming it, semanticSearch, replySuggestions, knowledgeLearning and the marketing footer fields included, since they belong to the whole workspace. The scope has to be an address in this workspace, a catch-all on a verified domain here with its catch-all on, or a domain in this workspace, or the call is a 422 invalid_parameter on address. A catch-all's values apply to the addresses its domain catches, and a new address created on that domain starts with a copy of them and changes on its own from then on.
signature is HTML added to mail sent from the address, and is sanitised on write, so the value you get back is what will actually be sent. More than 150,000 characters is a 422 signature_too_long, checked before sanitising and again after it. Mail sent through this API carries it only when the send sets 'signature': True, and template sends and encrypted sends never do.
Parameters
patch['signature']str | NoneHTML of the default signature of the address named by
address=, the one new mail from it carries, at most 150,000 characters, sanitised on write. An address keeps a list of signatures, whichsignatures.listreturns, and this field is the one that is the default for new mail. Writing it rewrites that signature, or adds one calledSignatureand makes it the default when the address has none. An empty string orNoneleaves new mail from the address with no signature, and replies too when they used the same one, and deletes nothing. Only with an address or a catch-all.patch['openEmailSignature']bool | NoneAdds the OpenEmail footer to mail from the address while its
signatureis empty. On by default.Noneremoves the address's own value. Only with an address or a catch-all.patch['trackOpens']bool | NoneOpen tracking on mail from the address, for sends whose
trackingdoes not setopens. Off by default.Noneremoves the address's own value. Only with an address or a catch-all.patch['trackClicks']bool | NoneLink tracking on mail from the address, for sends whose
trackingdoes not setclicks. Off by default.Noneremoves the address's own value. Only with an address or a catch-all.patch['externalImages']bool | NoneLoads pictures in mail automatically. Off means senders cannot tell you read it. On by default. The workspace's choice without
address=, and that scope's own with it.Noneremoves the scope's own value.patch['trustedSenders']list[str] | NoneSenders whose pictures always load while
externalImagesis off. Replaces the whole list. The workspace's list withoutaddress=, and that scope's own with it.Noneremoves the scope's own list.patch['blockedSenders']list[str] | NoneSenders whose mail is refused on arrival, plus-tags included. Mail already delivered stays. Replaces the whole list. The workspace's list without
address=, and that scope's own with it.Noneremoves the scope's own list.patch['blockedDomains']list[str] | NoneDomains whose mail is refused on arrival, subdomains included. Replaces the whole list. The workspace's list without
address=, and that scope's own with it.Noneremoves the scope's own list.patch['blockedWords']list[str] | NoneWords that open matching mail behind a warning. Nothing is deleted. Replaces the whole list. The workspace's list without
address=, and that scope's own with it.Noneremoves the scope's own list.patch['useDefaultBlockedWords']bool | NoneAdds the built-in list of English profanities and slurs to
blockedWords. Off by default. The workspace's choice withoutaddress=, and that scope's own with it.Noneremoves the scope's own value.patch['semanticSearch']bool | NoneSearch by meaning for the whole workspace. On by default.
Falsestops its mail going to the embedding model, deletes what was stored and makessemantic=Truerun a text search, andNoneturns it back on. Not withaddress=.patch['replySuggestions']bool | NoneSuggested replies for the whole workspace. On by default.
Falsestops threads going to a model for them and deletes the suggestions that were stored, andNoneturns them back on. Not withaddress=.patch['knowledgeLearning']bool | NoneKnowledge base learning for the whole workspace: notes suggested from sent replies, questions noted from incoming mail and conflict checks. On by default, and
Noneturns it back on. Not withaddress=.patch['marketingSenderName']str | NoneWho the footer of broadcasts and automation emails names as the sender, one line of at most 120 characters. Empty, the default, uses the workspace name, and
Noneempties it. Not withaddress=.patch['marketingPostalAddress']str | NoneThe postal address that footer shows, at most 500 characters on one line or several, which many countries require of marketing email. Empty, the default, shows none, and
Noneempties it. Not withaddress=.patch['workspaceName']strRenames this workspace, 1 to 64 characters once trimmed. A 422
invalid_parameteron a personal space. Not withaddress=.patch['language']strInterface language, a locale tag such as
enorde, saved as given without checking it. Saved on the account.patch['timezone']strIANA zone name such as
Europe/Berlin, saved as given without checking it. Saved on the account.patch['timeFormat']SettingsTimeFormat'12h'or'24h', how the app writes times, one ofSETTINGS_TIME_FORMATS. Saved on the account.patch['dateFormat']SettingsDateFormat'dmy','mdy'or'ymd', the order the app writes dates in, one ofSETTINGS_DATE_FORMATS. Saved on the account.patch['weekStart']SettingsWeekStart'monday'or'sunday', the first day of the week in the calendar and date pickers, one ofSETTINGS_WEEK_STARTS. Saved on the account.patch['colorTheme']SettingsColorTheme'light','dark'or'system', the app's theme, one ofSETTINGS_COLOR_THEMES. Saved on the account.patch['defaultEmailAlias']strAddress the app composer preselects as From. Saved on the account.
patch['undoSendEnabled']boolHolds each send from the app for 30 seconds so it can be cancelled. Off by default. Saved on the account.
patch['imageCompression']SettingsImageCompression'low','medium'or'original', how far pictures attached in the app are compressed before they are sent, one ofSETTINGS_IMAGE_COMPRESSIONS. Saved on the account.patch['attachmentDelivery']AttachmentDeliveryModeHow files go out on a send that does not set
attachmentDeliveryitself:'mime'attaches them,'link'sends download links, and'auto'links large files only, which needs a files address. Saved on the account.patch['autoRead']boolMarks mail read when you open it in the app. Saved on the account.
patch['aiWrittenLabel']boolShows the AI-written label on mail whose words look generated. Mail is scored either way and the sender is never told. Saved on the account.
patch['animations']boolMotion in the app. Off makes everything appear at once. Saved on the account.
patch['desktopNewMail']boolA desktop notification when a message reaches the inbox while the app is open in a browser that allows them. Saved on the account.
patch['desktopOnlyWhenHidden']boolDesktop notifications only while the tab is hidden. Saved on the account.
patch['phoneNewMail']boolA push to your phones when a message reaches the inbox. Saved on the account.
patch['phoneReplies']boolA push to your phones when someone answers your mail. Saved on the account.
patch['phoneScheduledSend']boolA push to your phones when a scheduled message goes out. Saved on the account.
patch['phoneFollowUps']boolA push to your phones when a message you asked to be reminded about has had no reply by then. Saved on the account.
patch['phoneSendFailures']boolA push to your phones when a message fails to send. Saved on the account.
patch['inboxTabs']boolShows the inbox as tabs: Primary, Promotions, Updates, Social and Forums. Mail is sorted either way, and turning this on sorts the last 1,000 inbox threads of the open workspace. Saved on the account.
patch['primaryOnlyAlerts']boolWith inbox tabs on, pushes, sounds and desktop notifications fire only for mail sorted into Primary. Saved on the account.
patch['phonePreviews']boolShows what a message says in its push. Off sends pushes without the content. Saved on the account.
patch['phoneSound']boolPlays a sound with each push. Off makes them silent. Saved on the account.
patch['phoneMutedWorkspaces']list[str]Workspace ids whose mail sends no push to your phones. Replaces the whole list.
account.set_push_mutedchanges one workspace at a time. Saved on the account.patch['soundNewMail']boolChimes when mail arrives while the app is open. Saved on the account.
patch['soundAiDone']boolChimes when the assistant finishes a reply. Saved on the account.
patch['soundSent']boolChimes when your message goes out. Saved on the account.
patch['translateLanguage']strThe language Translate offers first, a language code such as
de. Empty means the interface language. Saved on the account.patch['translateReplies']boolOpens replies on threads you translated already translated into your language. Saved on the account.
patch['showAvatarToContacts']boolShows your profile photo to OpenEmail users on your address. Saved on the account.
patch['lookupContactPhotos']boolFetches missing photos of the people you email from Gravatar and company logos. Saved on the account.
addressstrThe scope the patch gives a choice of its own: one address,
*@domainfor the catch-all of a domain, or@domainfor a whole domain. A key narrowed to particular addresses or domains may name only an address it holds, and a catch-all or a domain only when it holds that domain whole, or the call is a 422capability_unsupported.api_keystrOverrides the client's API key for this call only.
timeoutfloatSeconds this call may take, the response included, before it raises
OpenEmailNetworkErrorwithis_timeout. It overrides the client'stimeoutfor this call, and0turns the limit off.
Returns
SettingsResource, the full saved settings for the scope you named, in the same shape as get with the same address=.
Example
from openemail import openemail openemail.settings.update({'timezone': 'Europe/London'}) saved = openemail.settings.update( { 'signature': '<p>Ada Lovelace<br>Analytical Engines Ltd</p>', 'trackClicks': False, }, address='[email protected]',) print(saved.get('address'), saved.get('signature'), saved.get('trackClicks'))Notes
The SDK retries this call after a network failure or a retryable status, which is safe because the same patch saves the same values.
An empty dict is accepted, changes nothing and returns the current settings.
A misspelt zone or language code is saved rather than refused, so check it before sending, for example with
zoneinfo.ZoneInfoandresolve_language.