Skip to content

sr_pickup_blast v2.0.0 — 2026-03-15

Author: Dan Branch: jan Conflicts with staging-2: None


What Changed

  1. Token-based pickup response — Customers click "Need Pickup" or "Not right now" in emails. System auto-creates CRM leads and contact notes.
  2. Bot detection — Blocks python-requests, curl, SafeLinks, Googlebot from triggering false responses
  3. Per-mailing token isolation — Each email blast generates unique tokens, preventing cross-blast confusion
  4. Response analytics — Response rate tracking per customer, per mailing, time-of-day analysis
  5. Re-engagement campaigns — Auto follow-up emails to non-responders (cron, disabled by default)
  6. Response rate alerts — Configurable thresholds that notify managers when response rates drop
  7. A/B testing support — Track which email variant gets better response rates
  8. Security fixes — Fixed email link generation (QWeb syntax, not Jinja2), proper token validation

Deploy Commands

# 1. CRITICAL: Check for sr_mass_email_from_filter
# If installed, UNINSTALL it first (same model name conflict)
# Odoo UI: Apps > sr_mass_email_from_filter > Uninstall

# 2. Pull the code
git checkout ScottRecycling/jan -- sr_pickup_blast/

# 3. Upgrade (sr_management and sr_management_fixes must be current)
/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin \
  -c /etc/odoo17.conf -d <DATABASE> -u sr_pickup_blast --stop-after-init

# 4. Restart
sudo systemctl restart odoo17.service

Post-Deploy Configuration

CRITICAL: Set web.base.url system parameter to the correct server URL, or ALL email links will 404.

System Parameter Value Notes
web.base.url https://scottrecycling.com (prod) MUST be correct or links break
sr_pickup_blast.token_expiration_days 90 Default, adjust as needed

Cron jobs created but disabled by default: - Response Rate Check — enable after validating alerts work - Re-engagement Sending — enable after configuring re-engagement templates

Test Checklist

Test 1 (exp)

  • Module upgrades without errors
  • web.base.url set correctly for this server
  • Create a mass email wizard, select queue, preview
  • Send test email to yourself
  • Click "Need Pickup" link in email — CRM lead created
  • Click "Not right now" link — note created, no lead
  • Response shows in pickup blast responses list
  • Bot user agents are blocked (test with curl — should get "invalid" page)

Test 2 (1820)

  • Module upgrades without errors
  • All above tests pass
  • Response analytics view loads
  • Token expiration works (create expired token, verify blocked)

Staging (1717)

  • Module upgrades without errors
  • All above tests pass
  • Cron jobs visible (disabled by default)
  • web.base.url set to staging URL, not production

Programmer's Notes

  • web.base.url is the #1 deployment issue. If links 404, check this parameter FIRST. Every server needs its own value.
  • Bot detection checks User-Agent. List is in email_pickup_response.py — add new bots if false positives appear.
  • Token isolation: each mailing generates unique tokens. Tokens from mailing A cannot be used with mailing B.
  • Unsubscribe via pickup blast also unsubscribes from ALL Odoo mailings (mail.blacklist). This is by design (CAN-SPAM compliance).
  • The mass.email.wizard model name conflicts with sr_mass_email_from_filter. They cannot coexist. Uninstall sr_mass_email_from_filter before installing sr_pickup_blast.
  • Response time tracking uses response_time_hours — computed from token creation to click time.

Rollback

git checkout ScottRecycling/staging-2 -- sr_pickup_blast/
/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin \
  -c /etc/odoo17.conf -d <DATABASE> -u sr_pickup_blast --stop-after-init
sudo systemctl restart odoo17.service