Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
email_refresh_handler
What it is
Email feature: Lambda, triggered hourly by EventBridge, that re-subscribes a
slice of Gmail inboxes to push notifications (each inbox refreshed once per
day) by enqueuing LinkManagerMessages for email_service to process.
Start here
src/handler.rs: picks the due subset of email subscriptions and enqueues refresh messages;README.mdexplains the once-per-day cadence.src/context.rs/src/config.rs: DB pool and env setup.
Scope
- Owns: selecting which Gmail subscriptions are due for a
users.watchrefresh and publishing the SQS messages. - Not here: actually calling the Gmail
users.watchendpoint → theLinkManagerQueueconsumer inemail_service(src/pubsub/link_manager).
Checks
cargo test -p email_refresh_handler(SQLX_OFFLINEunset).