mirror of
https://github.com/warmbly/warmbly.git
synced 2026-08-19 16:01:16 +00:00
bd6a045751
Adds a dedicated admin path for sending platform email — distinct from the campaign emailsend service (which sends through customer mailboxes) so the two abuse surfaces never share code paths. Schema (000047) adds admin_outreach_messages: every send is recorded with sent_by, the resolved to_email, the optional reply_to, subject, body, and a queued → sent/failed status. Failed sends keep their error column populated for the audit log. Extends notify.EmailNotificationService with SendOutreach so both backends (SES + SMTP) support custom Reply-To: SES via the native ReplyToAddresses field, SMTP via a forged Reply-To header. The existing transactional Send() remains unchanged so no other caller is affected. Service (internal/app/adminoutreach) resolves recipients three ways: to_email (raw address), to_user_id (sends to the user's account email), or to_org_id (sends to the workspace owner). Persist-then-send-then- mark ensures the audit row exists even if the mailer hangs, and mark-failed captures the error string verbatim. Routes: POST /admin/outreach manage_organizations GET /admin/outreach view_organizations Admin UI: composer with recipient mode picker (email / user_id / org_id), configurable Reply-To (defaults to support@warmbly.com so customers can actually reply), subject + HTML body editor, and an outreach log below showing the last 50 sends with status badges and error details. Sidebar entry under Accounts (Send icon).