Docs / The latest edition as a branded HTML email
The latest edition as a branded HTML email
The latest edition as a branded HTML email
GET/v1/digest/{locale}/email
- Auth
- client bearer + quota
- Cache-Control
no-store- Source of truth
clients/openapi.jsonanddocs/API.md§12
The latest edition as the branded HTML email a subscriber's mail client receives: text/html, CSS inlined, absolute image and link URLs. It is rendered from the same composed digest as /v1/digest/{locale}, so the mail can never select different stories than the API serves.
Cache-Control: no-store, noETag, noLast-Modified. An edition changes under a fixed URL, so a cached copy would be a stale mail.- Absolute URLs come from
NEWS_PUBLIC_BASE_URLwhen it is set, otherwise from the request's own base URL. - Metered per delivered item id.
404and400are exactly the JSON route's cases (empty day, never-published locale, malformed locale tag), because both routes share one compose path.- Registered before
/v1/digest/{locale}/{day}soemailis not parsed as a day.
Description: docs/API.md §12
Parameters
| Name | In | Required | Type | Example | Notes |
|---|---|---|---|---|---|
locale | path | yes | string | en | A well-formed locale tag. Read the supported set from GET /v1/meta → locales. |
Example request
curl -sS \
'https://vg.tempproject.online/v1/digest/en/email' \
-H "Authorization: Bearer $NEWS_KEY"import json
import os
import urllib.request
URL = "https://vg.tempproject.online/v1/digest/en/email"
KEY = os.environ["NEWS_KEY"]
def call() -> dict:
req = urllib.request.Request(URL, headers={
"Authorization": f"Bearer {KEY}",
})
with urllib.request.urlopen(req, timeout=15) as res:
print(res.status, res.headers.get("ETag"))
return json.loads(res.read().decode("utf-8"))
if __name__ == "__main__":
body = call()
print(json.dumps(body, indent=2, ensure_ascii=False)[:2000])const res = await fetch(
"https://vg.tempproject.online/v1/digest/en/email",
{
method: "GET",
headers: {
authorization: `Bearer ${process.env.NEWS_KEY}`,
},
},
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.
Example response
cache-control: no-store
content-type: application/octet-streamNo JSON body on this route; the headers are the ones docs/API.md §2 documents for it
Failures
This operation can answer 200, 401, 422, 429. The full envelope for each status, with its body, is on Errors.