문서로 건너뛰기
Ruby

client.analytics

이 네임스페이스의 모든 메서드: 시그니처, 매개변수, 반환값과 예시.

메서드

The numbers behind the Analytics page: how mail arrives in the mailbox, and what became of the mail the workspace sent.

analytics.mailbox

Read how mail arrives

범위threads:read
시그니처
mailbox(from: nil, to: nil, offset_minutes: nil, grain: nil, address: nil, api_key: nil) -> Hash

Returns how mail arrives, as the Analytics page of the app shows it, for a window, the last 30 days unless from: and to: say otherwise: how many conversations arrived and when, per grain bucket in days and per hour of the day in hours, the addresses they arrived at, the senders who wrote most, how many conversations wait on a reply for 1, 3 or 7 days or more, and the folders.

days is sparse: a bucket in which nothing arrived has no entry, so a chart must fill the gaps. offset_minutes: shifts the boundaries so days and hours break where the reader's do, and series holds the per bucket counts of the top addresses and senders so each can be charted.

A key limited to particular addresses counts only the mail that arrived at them, and address: narrows everything to one address. An address the key does not reach counts nothing rather than failing.

매개변수

fromTime, Date or String

The start of the window. Defaults to 30 days before to:.

toTime, Date or String

The end of the window. Defaults to now.

offset_minutesInteger

Minutes east of UTC, from -840 to 840, defaulting to 0. Pass Time.now.utc_offset / 60 for the local zone.

grainString

Bucket width: minute, hour or day, defaulting to day.

addressString

Count only the mail delivered to this address.

api_keyString

Overrides the client's API key for this call only.

반환값

A Hash with object set to mailbox_insights, from, to, grain, offsetMinutes, scanned, days, hours, addresses, senders, senderCount, waiting, unattributed, folders and series.

예시

insights = client.analytics.mailbox(offset_minutes: Time.now.utc_offset / 60) puts "#{insights[:scanned]} conversations from #{insights[:senderCount]} senders" insights[:senders].each { |sender| puts "#{sender[:email]} #{sender[:count]}" }

참고

  • Read only, so the SDK retries it after a network failure like any other read.

  • from: after to: is a 422 invalid_parameter.

다른 사용처

API
GET /analytics/mailbox
TypeScript
analytics.mailbox()
Python
analytics.mailbox()
CLI
openemail analytics mailbox

analytics.sending

Read what became of sent mail

범위emails:read
시그니처
sending(days: nil, minutes: nil, offset_minutes: nil, grain: nil, address: nil, api_key: nil) -> Hash

Returns the numbers behind the Analytics page of the app: what the workspace sent inside a window and what became of it. totals adds up the sends, recipients and test sends and how many were delivered, failed, bounced, complained about, uncertain or still pending, days cuts sent, delivered, failed, bounced and complained to grain buckets, and statuses, sources, senders and suppressed break the window down.

The window is days:, 30 by default and at most 365, or minutes:, which wins when both are sent. It ends now, reported as until, and starts at the beginning of its oldest bucket, reported as since. offset_minutes: shifts the bucket boundaries so days break where the reader's do.

A key limited to particular addresses counts only the mail sent from them, and address: narrows everything to one address.

매개변수

daysInteger

Window length in days, from 1 to 365, defaulting to 30.

minutesInteger

Window length in minutes, which wins over days:.

offset_minutesInteger

Minutes east of UTC, from -840 to 840, defaulting to 0.

grainString

Bucket width: minute, hour or day, defaulting to day.

addressString

Count only the mail sent from this address.

api_keyString

Overrides the client's API key for this call only.

반환값

A Hash with object set to sending_analytics, since, until, grain, offsetMinutes, totals, days, statuses, sources, senders and suppressed.

예시

analytics = client.analytics.sending(days: 7) sends, delivered, bounced = analytics[:totals].values_at(:sends, :delivered, :bounced) puts "#{delivered} of #{sends} delivered, #{bounced} bounced"

참고

  • Read only, so the SDK retries it after a network failure like any other read.

다른 사용처

API
GET /analytics/sending
TypeScript
analytics.sending()
Python
analytics.sending()
CLI
openemail analytics sending