client.Analytics
Bu ad alanındaki her yöntem: imzası, parametreleri, döndürdüğü değer ve bir örnek.
Yöntemler
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
Mailbox(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)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. offsetMinutes 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.
Parametreler
openemail.WithFromtime.TimeThe start of the window. Defaults to 30 days before
to.openemail.WithTotime.TimeThe end of the window. Defaults to now.
openemail.WithOffsetMinutesintMinutes east of UTC, from -840 to 840, defaulting to 0. For the local zone, pass the offset
time.Now().Zone()reports, divided by 60.openemail.WithGrainstringBucket width:
minute,hourorday, defaulting today.openemail.WithAddressstringCount only the mail delivered to this address.
openemail.WithAPIKeystringOverrides the client's API key for this call only.
Döndürür
An openemail.Object with object set to mailbox_insights, from, to, grain, offsetMinutes, scanned, days, hours, addresses, senders, senderCount, waiting, unattributed, folders and series.
Örnek
_, offset := time.Now().Zone() insights, err := client.Analytics.Mailbox(ctx, openemail.WithOffsetMinutes(offset/60))if err != nil { return err} fmt.Println(insights.Int("scanned"), "conversations from", insights.Int("senderCount"), "senders") for _, sender := range insights.Objects("senders") { fmt.Println(sender.String("email"), sender.Int("count"))}Notlar
Read only, so the SDK retries it after a network failure like any other read.
fromaftertois a 422invalid_parameter.
Şurada da var
Analytics.Sending
Read what became of sent mail
Sending(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)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, streams, 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. offsetMinutes 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.
Parametreler
openemail.WithDaysintWindow length in days, from 1 to 365, defaulting to 30.
openemail.WithMinutesintWindow length in minutes, which wins over
days.openemail.WithOffsetMinutesintMinutes east of UTC, from -840 to 840, defaulting to 0.
openemail.WithGrainstringBucket width:
minute,hourorday, defaulting today.openemail.WithAddressstringCount only the mail sent from this address.
openemail.WithAPIKeystringOverrides the client's API key for this call only.
Döndürür
An openemail.Object with object set to sending_analytics, since, until, grain, offsetMinutes, totals, days, statuses, sources, streams, senders and suppressed.
Örnek
analytics, err := client.Analytics.Sending(ctx, openemail.WithDays(7))if err != nil { return err} fmt.Println(analytics.String("object"))Notlar
Read only, so the SDK retries it after a network failure like any other read.