MillionSend.Usage (MillionSend v0.4.0)

Copy Markdown View Source

Plan limits and today's send count — a MillionSend extension with no Resend equivalent.

cloud is true on MillionSend Cloud, where plan and limits apply; self-hosted deployments report plan: nil and nil limits. limits ("emails_per_day", "domains"), today ("emails_sent", "resets_at") and team ("id", "name") are string-keyed maps as returned by the API.

{:ok, usage} = MillionSend.Usage.get()
usage.today["emails_sent"]

Summary

Types

t()

@type t() :: %MillionSend.Usage{
  app_url: term(),
  cloud: term(),
  limits: term(),
  object: term(),
  plan: term(),
  team: term(),
  today: term()
}

Functions

get(client \\ MillionSend.client())

@spec get(MillionSend.Client.t()) :: {:ok, t()} | {:error, MillionSend.Error.t()}

GET /usage