Context
ScoutBot emails currently include an unsubscribe link in the footer (mailto: link). However, Gmail's bulk sender guidelines (effective Feb 2024) require one-click List-Unsubscribe headers for senders to more than 5,000 recipients per day.
Without these headers:
- Gmail may route ScoutBot emails to Promotions or Spam
- Bulk senders without headers face increased filtering from 2024 onwards
Task
Add standard List-Unsubscribe and List-Unsubscribe-Post headers to every outgoing digest email.
msg["List-Unsubscribe"] = f"<mailto:{SENDER_EMAIL}?subject=Unsubscribe>"
msg["List-Unsubscribe-Post"] = "List-Unsubscribe=One-Click"
These go in _build_personal_email() in notify.py.
Stretch goal
Build a tiny unsubscribe endpoint so Gmail's one-click unsubscribe button works — clicking it in Gmail sends a POST request to a URL you control which removes the address from the sheet automatically. (Could be a minimal Flask app or a free serverless function.)
Files to touch
notify.py — _build_personal_email()
- Optionally: new
unsubscribe.py or hosted endpoint
References
Context
ScoutBot emails currently include an unsubscribe link in the footer (
mailto:link). However, Gmail's bulk sender guidelines (effective Feb 2024) require one-click List-Unsubscribe headers for senders to more than 5,000 recipients per day.Without these headers:
Task
Add standard
List-UnsubscribeandList-Unsubscribe-Postheaders to every outgoing digest email.These go in
_build_personal_email()innotify.py.Stretch goal
Build a tiny unsubscribe endpoint so Gmail's one-click unsubscribe button works — clicking it in Gmail sends a POST request to a URL you control which removes the address from the sheet automatically. (Could be a minimal Flask app or a free serverless function.)
Files to touch
notify.py—_build_personal_email()unsubscribe.pyor hosted endpointReferences