Closes #9. Auto-insert tracked homepage links in campaign compose, register them with url_shortening_service, and put short piha.li URLs in SMS, email hrefs, and postcard QR codes when SHORTENER_* is configured.
This commit is contained in:
@@ -35,6 +35,23 @@ webhook events match the correct recipient row. Invalid / missing header values
|
||||
no longer 500 the endpoint (SMTP2GO “Test this webhook” often sends a sample
|
||||
non-UUID).
|
||||
|
||||
## Campaign tracked links (UTM + piha.li)
|
||||
|
||||
Composer auto-inserts a homepage link:
|
||||
|
||||
| Param | Value |
|
||||
|-------|--------|
|
||||
| `utm_source` | `monica` |
|
||||
| `utm_medium` | `email` / `sms` / `postcard` |
|
||||
| `utm_campaign` | hyphenated campaign name |
|
||||
|
||||
When `SHORTENER_BASE_URL` + `SHORTENER_API_TOKEN` are set, the app POSTs that
|
||||
long HTTPS URL to `url_shortening_service` (`POST /api/links/`, Bearer
|
||||
`monica:<secret>`) and puts `short_url` (`https://piha.li/<code>`) in SMS,
|
||||
email hrefs, and postcard QR codes. Empty env → long UTM URL (local default).
|
||||
|
||||
Mint against the **API host**, not `piha.li`. See `.env.example` / `.env.prod.example`.
|
||||
|
||||
SMS correlation uses `message_id` (SMS id), then `destination_number` phone
|
||||
fallback. Do **not** treat webhook `id` as the SMS id.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user