Template
## Summary - Port Monica campaign UTM + piha.li minting into always-on `core` (`shortener.py`, `campaign_utm.py`) so `email_sms` and `directmail` stay optional and never import each other. - `utm_source` is a slug of `SITE_NAME` (override with `UTM_SOURCE`). Email gets an HTML `data-campaign-utm` link; SMS gets a plain URL; postcard QR only — no body inject. - Live composer mints through login+CSRF `POST /portal/campaigns/short-link/` (registered only when an outreach app is installed). Empty `SHORTENER_*` falls back to the long UTM URL. Reference: [monica_site PR #10](ai_ml_operations/monica_site#10) Closes #3 ## Test plan - [x] `cd site && uv run python manage.py test` (125 tests) - [ ] Email composer: type a name, confirm HTML link + `utm_campaign` updates, save draft - [ ] SMS composer: plain `piha.li` (or long UTM if shortener unset) in the body - [ ] Postcard composer: QR copies the tracked URL; campaign body has no `utm_source` - [ ] Campaign report pages show the same panel - [ ] With `FEATURE_EMAIL_SMS` and `FEATURE_DIRECT_MAIL` off, no extra nav and no `/portal/campaigns/short-link/` route Reviewed-on: #4
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
from django.urls import path
|
|
|
|
from directmail import views
|
|
|
|
app_name = "directmail"
|
|
|
|
urlpatterns = [
|
|
path("campaigns/", views.campaign_list, name="campaign_list"),
|
|
path("campaigns/<uuid:pk>/", views.campaign_detail, name="campaign_detail"),
|
|
path(
|
|
"campaigns/<uuid:pk>/status.json",
|
|
views.campaign_status_json,
|
|
name="campaign_status_json",
|
|
),
|
|
path("campaigns/<uuid:pk>/send/", views.campaign_send, name="campaign_send"),
|
|
path(
|
|
"campaigns/upload-image/",
|
|
views.campaign_image_upload,
|
|
name="campaign_image_upload",
|
|
),
|
|
path(
|
|
"campaigns/<uuid:pk>/messages/<uuid:message_id>/remove/",
|
|
views.campaign_message_remove,
|
|
name="campaign_message_remove",
|
|
),
|
|
path("postcard/", views.postcard_designer, name="postcard_designer"),
|
|
path(
|
|
"postcard/create/",
|
|
views.postcard_design_create,
|
|
name="postcard_design_create",
|
|
),
|
|
path(
|
|
"postcard/save/",
|
|
views.postcard_design_save,
|
|
name="postcard_design_save",
|
|
),
|
|
path(
|
|
"webhooks/postcard/",
|
|
views.postcard_webhook,
|
|
name="postcard_webhook",
|
|
),
|
|
]
|