For the complete documentation index, see llms.txt. This page is also available as Markdown.

Contact Us Subjects

Administrative endpoints for contact us subjects — the subjects a shopper chooses from on the storefront contact form. Each subject decides whether the form must reference an order and which addresses the submitted message is e-mailed to.

The storefront reads the same records through its own contact form endpoints; these endpoints are for managing them.

Core Capabilities

1. Listing

  • Retrieve a paginated list of subjects. Order the results with the sort parameter.

2. Subject Management

  • Create a subject, retrieve a single subject, fully (PUT) or partially (PATCH) update it, and delete it.

Contact Us Subject Fields

Field
Type
Description

pk

integer

The unique identifier of the subject. Read-only.

text

string (max 60)

The subject label shown on the contact form. Translatable (see Translations). Required on create and full update; may not be blank.

is_order_needed

boolean

Whether the storefront contact form requires an order to be selected for this subject. Required on create; optional on update.

recipients

array of e-mail strings, or null

The addresses messages sent with this subject are e-mailed to. Each item must be a valid e-mail address of at most 254 characters. The list may be null but not empty — [] is rejected with 400 and {"recipients": ["..."]}. An invalid address is reported under its zero-based index, e.g. {"recipients": {"0": ["Enter a valid email address."]}}. When null, the storefront falls back to CONTACT_US_EMAIL_TO (see Dynamic Settings & Environment Variables).

Translations

text is translatable. It is written to, and read from, the language selected for the request:

  • In the default language (LANGUAGE_CODE) the value is stored on the subject itself.

  • Create in any other configured language stores text both on the subject itself and as the translation for that language.

  • Update in any other configured language stores text only as the translation for that language; the default-language value is left unchanged.

  • List and retrieve return the translation for the request language, falling back to the default-language value when no translation exists.

is_order_needed and recipients are shared by all languages. Ordering by text always uses the default-language value. Whether the Accept-Language header can select the request language is controlled by IGNORE_ACCEPT_LANGUAGE_HEADER.

Form-Encoded Requests

The write operations also accept multipart/form-data and application/x-www-form-urlencoded bodies. In a form-encoded create or full update (PUT), a missing is_order_needed is read as false instead of being left out. Send it explicitly, or use JSON.

Filtering & Ordering

No filters are available; unknown query parameters are ignored. Use the sort parameter to order the results by pk, text, is_order_needed or recipients (for example sort=-pk); prefix a field with a hyphen for descending order. Other field names are ignored. Without sort, results are ordered by pk.

Deleting a Contact Us Subject

DELETE is a hard delete. The subject is removed immediately and is no longer offered on the storefront contact form.

Dynamic Settings & Environment Variables

Dynamic settings (dj_dynamic_settings):

Key
Type
Default
Effect

IGNORE_ACCEPT_LANGUAGE_HEADER

boolean

true (falls back to the same-named Django setting)

Whether the Accept-Language header is discarded before the request is processed. While it is true, the header is honored only when the request also carries an X-Omnitron-Session header; otherwise the default language is used. Affects every operation: the selected language decides which translation of text is written by create and update requests and returned by every response (see Translations).

IGNORE_DELETED_ITEMS_SIGNAL

array of strings

["django_audit_events.AuditEvent", "django_audit_events.ArchivedAuditEvent", "sessions.Session", "datawarehouse.DeletedItem"] (falls back to the same-named Django setting)

The model labels excluded from delete tracking. Affects delete: unless users.ContactUsSubject is added to this list, deleting a subject also records a deleted-item entry for the data-warehouse export. The API response is identical either way.

CONTACT_US_EMAIL_TO

object mapping an operation name, or defaults, to an e-mail address or a list of addresses

{"defaults": ["contactus@akinon.com"]} (falls back to the CONTACT_US_EMAIL_TO env var / Django setting)

The addresses storefront contact form messages are sent to when the chosen subject has no recipients. It does not change the requests or responses of these endpoints.

Environment variables / Django settings:

Setting
Default
Effect

LANGUAGE_CODE

tr-tr

The default language. text written in this language is stored on the subject itself.

LANGUAGES

tr-tr only

The languages the site supports. A language that is not listed here cannot be selected for a request, so translations for it cannot be written or read.

Last updated

Was this helpful?