client.settings()
Cada método de este espacio de nombres: su firma, sus parámetros, lo que devuelve y un ejemplo.
Métodos
Mailbox preferences such as timezone and language, and the signature and tracking of each address.
settings().get
Read settings
Map<String, Object> get(RequestOptions options)Returns 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. Its keys are the fields update takes, plus object, address and 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, developerMode 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 null for at the same scope, and everything not in it is inherited. address on the result is the scope you named, lowercased, or null.
Parámetros
options.addressStringThe 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.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map with object set to settings, every setting, developerMode and overrides, a map of what the scope sets itself.
Ejemplo
Map<String, Object> settings = client.settings().get(); System.out.println(settings.get("timezone") + " " + settings.get("timeFormat") + " " + settings.get("developerMode"));Notas
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.
También disponible en
- API
GET /settings- TypeScript
settings.get()- Python
settings.get()- Ruby
settings.get- PHP
settings->get- Go
Settings.Get- C#
Settings.GetAsync- CLI
openemail settings get
settings().update
Change settings
Map<String, Object> update(Map<String, Object> patch, RequestOptions options)A 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 map 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. developerMode and the privacy fields (externalImages, trustedSenders, blockedSenders, blockedDomains, blockedWords, useDefaultBlockedWords, semanticSearch, replySuggestions, knowledgeLearning) are saved on the workspace, and null 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 RequestOptions.of("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().replySuggestions 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 null 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. Null 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 and knowledgeLearning 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.
Parámetros
patch.signatureString or nullHTML signature of the address named by
address, at most 150,000 characters, sanitised on write. An empty string removes it, and null makes the address use the one it inherits again. Only with an address or a catch-all.patch.openEmailSignaturebooleanAdds the OpenEmail footer to mail from the address while its
signatureis empty. On by default. Null removes the address's own value. Only with an address or a catch-all.patch.trackOpensbooleanOpen tracking on mail from the address, for sends that do not set
tracking.opens. Off by default. Null removes the address's own value. Only with an address or a catch-all.patch.trackClicksbooleanLink tracking on mail from the address, for sends that do not set
tracking.clicks. Off by default. Null removes the address's own value. Only with an address or a catch-all.patch.externalImagesbooleanLoads 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. Null removes the scope's own value.patch.trustedSendersList<String> or nullSenders whose pictures always load while
externalImagesis off. Replaces the whole list. The workspace's list withoutaddress, and that scope's own with it. Null removes the scope's own list.patch.blockedSendersList<String> or nullSenders 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. Null removes the scope's own list.patch.blockedDomainsList<String> or nullDomains 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. Null removes the scope's own list.patch.blockedWordsList<String> or nullWords 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. Null removes the scope's own list.patch.useDefaultBlockedWordsbooleanAdds 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. Null removes the scope's own value.patch.semanticSearchbooleanSearch by meaning for the whole workspace. On by default.
falsestops its mail going to the embedding model, deletes what was stored and makesRequestOptions.of("semantic", true)run a text search, and null turns it back on. Not withaddress.patch.replySuggestionsbooleanSuggested replies for the whole workspace. On by default.
falsestops threads going to a model for them and deletes the suggestions that were stored, and null turns them back on. Not withaddress.patch.knowledgeLearningbooleanKnowledge base learning for the whole workspace: notes suggested from sent replies, questions noted from incoming mail and conflict checks. On by default, and null turns it back on. Not with
address.patch.developerModebooleanDeveloper mode for the whole workspace: on, the app shows API keys, webhooks and ids to everyone in it, and off hides those screens. Keys that exist keep working either way. Off by default, and null puts it back to off. Not with
address.patch.workspaceNameStringRenames this workspace, 1 to 64 characters once trimmed. A 422
invalid_parameteron a personal space. Not withaddress.patch.languageStringInterface language, a locale tag such as
enorde, saved as given without checking it. Saved on the account.patch.timezoneStringIANA zone name such as
Europe/Berlin, saved as given without checking it. Saved on the account.patch.timeFormatString12hor24h, also inuk.openemail.constants.SettingsTimeFormats, how the app writes times. Saved on the account.patch.dateFormatStringdmy,mdyorymd, also inuk.openemail.constants.SettingsDateFormats, the order the app writes dates in. Saved on the account.patch.weekStartStringmondayorsunday, also inuk.openemail.constants.SettingsWeekStarts, the first day of the week in the calendar and date pickers. Saved on the account.patch.colorThemeStringlight,darkorsystem, also inuk.openemail.constants.SettingsColorThemes, the app's theme. Saved on the account.patch.defaultEmailAliasStringAddress the app composer preselects as From. Saved on the account.
patch.undoSendEnabledbooleanHolds each send from the app for 30 seconds so it can be cancelled. Off by default. Saved on the account.
patch.imageCompressionStringlow,mediumororiginal, also inuk.openemail.constants.SettingsImageCompressions, how far pictures attached in the app are compressed before they are sent. Saved on the account.patch.attachmentDeliveryStringHow files go out on a send that does not set
attachmentDeliveryitself:mimeattaches them,linksends download links, andautolinks large files only, which needs a files address. Saved on the account.patch.autoReadbooleanMarks mail read when you open it in the app. Saved on the account.
patch.aiWrittenLabelbooleanShows 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.animationsbooleanMotion in the app. Off makes everything appear at once. Saved on the account.
patch.desktopNewMailbooleanA desktop notification when a message reaches the inbox while the app is open in a browser that allows them. Saved on the account.
patch.desktopOnlyWhenHiddenbooleanDesktop notifications only while the tab is hidden. Saved on the account.
patch.phoneNewMailbooleanA push to your phones when a message reaches the inbox. Saved on the account.
patch.phoneRepliesbooleanA push to your phones when someone answers your mail. Saved on the account.
patch.phoneScheduledSendbooleanA push to your phones when a scheduled message goes out. Saved on the account.
patch.phoneFollowUpsbooleanA push to your phones when a message you asked to be reminded about has had no reply by then. Saved on the account.
patch.phoneSendFailuresbooleanA push to your phones when a message fails to send. Saved on the account.
patch.inboxTabsbooleanShows 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.primaryOnlyAlertsbooleanWith inbox tabs on, pushes, sounds and desktop notifications fire only for mail sorted into Primary. Saved on the account.
patch.phonePreviewsbooleanShows what a message says in its push. Off sends pushes without the content. Saved on the account.
patch.phoneSoundbooleanPlays a sound with each push. Off makes them silent. Saved on the account.
patch.phoneMutedWorkspacesList<String>Workspace ids whose mail sends no push to your phones. Replaces the whole list.
account().setPushMutedchanges one workspace at a time. Saved on the account.patch.soundNewMailbooleanChimes when mail arrives while the app is open. Saved on the account.
patch.soundAiDonebooleanChimes when the assistant finishes a reply. Saved on the account.
patch.soundSentbooleanChimes when your message goes out. Saved on the account.
patch.translateLanguageStringThe language Translate offers first, a language code such as
de. Empty means the interface language. Saved on the account.patch.translateRepliesbooleanOpens replies on threads you translated already translated into your language. Saved on the account.
patch.showAvatarToContactsbooleanShows your profile photo to OpenEmail users on your address. Saved on the account.
patch.lookupContactPhotosbooleanFetches missing photos of the people you email from Gravatar and company logos. Saved on the account.
options.addressStringThe 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.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map, the full saved settings for the scope you named, in the same shape as get with the same address.
Ejemplo
Map<String, Object> saved = client.settings().update(Body.of("timezone", "Europe/London", "timeFormat", "24h", "developerMode", true)); System.out.println(saved.get("address") + " " + saved.get("signature") + " " + saved.get("overrides"));Notas
The SDK retries this call after a network failure, which is safe because the same patch saves the same values.
An empty patch is accepted, changes nothing and returns the current settings.
A misspelt zone or language code is saved rather than refused, so validate it before sending.