Skip to content

FEAT: Plugin API - account info API #513

@andrinoff

Description

@andrinoff

Is your feature request related to a problem?

Plugins have no way to query account information. There is no matcha.accounts() or matcha.current_account() API. Multi-account setups can't have account-specific plugin behavior (e.g. different signatures per account, different auto-BCC rules, account-specific workflows).

Describe the solution you'd like

Add API functions:

-- Get the currently active account
local acct = matcha.current_account()
-- acct.email, acct.name, acct.id

-- List all configured accounts
local accounts = matcha.accounts()
for _, acct in ipairs(accounts) do
    matcha.log(acct.email)
end

Only expose safe, read-only fields (email, display name, account ID). Do not expose passwords, tokens, or server credentials.

Describe alternatives you've considered

Using the account_id field already present in hook email tables and hardcoding known IDs. This is fragile and doesn't let plugins discover accounts dynamically.

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions