Add campaign UTM links and piha.li shortener as a core helper.

Keep mint/UTM in always-on core so email_sms and directmail stay optional, and brand utm_source from SITE_NAME (or UTM_SOURCE) instead of a hardcoded client name.
Closes westfarn/web_django_template#3
This commit is contained in:
2026-09-01 15:37:49 -05:00
parent 3a14bfb996
commit b62357c8be
25 changed files with 1344 additions and 16 deletions
+20
View File
@@ -61,3 +61,23 @@ server-infra Ansible deploy.
Ollama for social drafts lives on the LAN at `http://10.0.0.128:11434`.
Do not call a public Ollama host.
## Campaign tracked links (piha.li)
When `FEATURE_EMAIL_SMS` or `FEATURE_DIRECT_MAIL` is on, composers auto-insert a
homepage URL with `utm_source` (slug of `SITE_NAME`, or `UTM_SOURCE`),
`utm_medium` = channel, and `utm_campaign` = campaign name. Configured
`SHORTENER_BASE_URL` + `SHORTENER_API_TOKEN` mint that URL via
[url_shortening_service](https://git.aimloperations.com/ai_ml_operations/url_shortening_service)
and put `piha.li` / `beta.piha.li` short links in SMS, email hrefs, and postcard QR codes.
Caller secrets (this repo's env file):
```text
SHORTENER_BASE_URL=https://shortener.aimloperations.com
SHORTENER_API_TOKEN=<slug>:<secret>
```
Operator secrets (`url_shortening_service_*`): `SHORTENER_API_TOKENS=<slug>:<same-secret>`
and `SHORT_ALLOWED_HOSTS` must include the client domain. Mint against the **API host**,
never `piha.li`.