ONE email:products-preview
← Receivers

email:products-preview

email family

The products an email product block would show, before it sends: mode picked · best_sellers · newest · for_you (one recipient by address, or the group-level answer), up to 6. source says which rule answered: for_you with no data for the person falls back to best_sellers (or newest with no sales), shop_off when the shop is not enabled, none when nothing matched. Reads your own group only

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
owner
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/email:products-preview \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "mode": <string>, "productIds": <any>, "count": <number>, "address": <string> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • mode string optional picked · best_sellers (default) · newest · for_you; anything else reads as best_sellers
  • productIds any optional picked mode: a comma list, a string[] or [{ pid }]
  • count number optional 1 to 6, default 3
  • address string optional for_you: the recipient's email address

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • mode string
  • source string picked · best_sellers · newest · for_you · shop_off · none
  • products object[]
  • count number
  • error string sign_in_required · no_db

Traffic

Every call to email:products-preview, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names email:products-preview, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 2
  • one.ie/web/src/lib/receiver-index.generated.ts:189
  • one.ie/web/src/lib/resolvers/email-content.ts:42
CLI 2
  • packages/cli/src/lib/receivers-index.generated.ts:191
  • packages/cli/src/lib/receivers.generated.ts:191
→

Answered by

email:products-preview one.ie/web/src/lib/resolvers/email-content.ts:62 Dispatched through POST /api/ask/email:products-preview, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "mode": {
      "description": "picked · best_sellers (default) · newest · for_you; anything else reads as best_sellers",
      "type": "string"
    },
    "productIds": {
      "description": "picked mode: a comma list, a string[] or [{ pid }]"
    },
    "count": {
      "description": "1 to 6, default 3",
      "type": "number"
    },
    "address": {
      "description": "for_you: the recipient's email address",
      "type": "string"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "mode": {
      "type": "string"
    },
    "source": {
      "description": "picked · best_sellers · newest · for_you · shop_off · none",
      "type": "string"
    },
    "products": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pid": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "string"
          },
          "compareAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "imageUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "href": {
            "type": "string"
          }
        },
        "required": [
          "pid",
          "name",
          "price",
          "compareAt",
          "imageUrl",
          "href"
        ]
      }
    },
    "count": {
      "type": "number"
    },
    "error": {
      "description": "sign_in_required · no_db",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}