Bulk email — staff working this week
Send a single template to every worker with an active placement in a date window. Defaults to "this week" (Mon → Sun); operator can pick any window. Used for weekly site notices, induction reminders, schedule changes.
Audience query: placements with status in draft / open / in_progress, whose start..end date range intersects the window, where the linked Person has a non-empty email address.
Template picker filtered to templates with entity_type=placement (or universal templates with entity_type=null). Same visibility scope as the rest of the add-on (system OR your groups).
Per-recipient resolution: the placeholder context for each send carries that worker's placement + person + tenant. {{to_first_name}} resolves to their name, {{placement_role}} to their role, etc.
One comm_log row per recipient — full audit chain. Each row stamps source=email_addon_bulk_this_week plus the window dates + placement_id in the context JSON.
Sends are synchronous in v1. Fine for typical labour-hire workforces (50-500 workers). Past about 500 recipients we'd move this to a queued job to avoid PHP timeout — a planned follow-up.
email-bulk-this-week_1.png